Jump to content


Photo

Executar Javascript De Páginas Requisitadas (Ajax)


  • Faça o login para participar
9 replies to this topic

#1 Eu_Nana

Eu_Nana

    12 Horas

  • Usuários
  • 291 posts
  • Sexo:Feminino
  • Localidade:SP

Posted 16/03/2010, 10:56

Olá pessoal,

Preciso executar uma função JS dentro de uma página carregada via ajax......não estou conseguindo......alguém pode me ajudar.....Bom tenho uma página q precisa ter um menu accordion.....quando carrego essa página dentro da div...o JS para de funcionar se carrego fora da div....o JS funciona.....não sei mais oq fazer......alguém pode me dar uma luz por favor?






#2 Willian Gustavo Veiga

Willian Gustavo Veiga

    12 Horas

  • Usuários
  • 175 posts
  • Sexo:Masculino

Posted 16/03/2010, 11:13

Bom dia, tudo bem?

Poste o código, por favor.

Obrigado.
Posted Image

#3 Eu_Nana

Eu_Nana

    12 Horas

  • Usuários
  • 291 posts
  • Sexo:Feminino
  • Localidade:SP

Posted 16/03/2010, 11:25

Bom dia, tudo bem?

Poste o código, por favor.

Obrigado.





Bom segue abaixo os códigos...


home.php - Página que carrego via ajax dentro de div

<link href="css/estilos.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="../js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="menu.js"></script>
<style type="text/css">
body {
    margin: 10px auto;
    font: 75%/120% Verdana,Arial, Helvetica, sans-serif;
}
.menu_list {    
    width: 150px;
}
.menu_head {
    padding: 5px 10px;
    cursor: pointer;
    position: relative;
    margin:1px;
    font-weight:bold;
    background: #eef4d3 url(plus.png) center right no-repeat;
}
.menu_body {
    display:none;
}
.menu_body a{
  display:block;
  color:#006699;
  background-color:#EFEFEF;
  padding-left:10px;
  font-weight:bold;
  text-decoration:none;
}
.menu_body a:hover{
  color: #000000;
  text-decoration:underline;
  }
</style>



   <div id="geral">     
        <div id="conteudo">
            
             <div style="float:left" > 
        <p><strong>MENU</strong></p>
                  <div id="firstpane" class="menu_list"> 
                <p class="menu_head">Menu-1</p>
                <div class="menu_body">
        <a href="#">Link-1</a>
         <a href="#">Link-2</a>
         <a href="#">Link-3</a>    
        </div>
        <p class="menu_head">Menu-2</p>
        <div class="menu_body">
            <a href="#">Link-1</a>
         <a href="#">Link-2</a>
         <a href="#">Link-3</a>    
        </div>
        <p class="menu_head">Menu-3</p>
        <div class="menu_body">
          <a href="#">Link-1</a>
         <a href="#">Link-2</a>
         <a href="#">Link-3</a>            
       </div>
  </div>  
</div>
          
        </div>

</div>

menu.js

$(document).ready(function()
{
    //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked 
    $("#firstpane p.menu_head").click(function()
    {
        $(this).css({backgroundImage:"url(minus.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
           $(this).siblings().css({backgroundImage:"url(plus.png)"});
    });
    //slides the element with class "menu_body" when mouse is over the paragraph
    $("#secondpane p.menu_head").mouseover(function()
    {
         $(this).css({backgroundImage:"url(minus.png)"}).next("div.menu_body").slideDown(500).siblings("div.menu_body").slideUp("slow");
         $(this).siblings().css({backgroundImage:"url(plus.png)"});
    });
});

funcções ajax q uso para carregar as paginas dentro da div

ajax.js

function GetXMLHttp() {
    
    var xmlHttp;
    try {
        xmlHttp = new XMLHttpRequest();
    }
    catch(ee) {
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e) {
                xmlHttp = false;
            }
        }
    }
    return xmlHttp;
}

var xmlRequest = GetXMLHttp();

instrucao.js

function abrirPag(valor){
    var url = valor;
    
    xmlRequest.open("GET",url,true);
    xmlRequest.onreadystatechange = mudancaEstado;
    xmlRequest.send(null);

        if (xmlRequest.readyState == 1) {
            document.getElementById("conteudo").innerHTML = "<img src='loading.gif'>";
        }
        
    return url;    
}

function mudancaEstado(){
    if (xmlRequest.readyState == 4){
        document.getElementById("conteudo").innerHTML = xmlRequest.responseText;
    }
}
Se puder me ajudar....agradeço muito...

Edição feita por: Eu_Nana, 16/03/2010, 11:26.


#4 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 25/09/2017, 12:45

Cialis Posologia generic cialis Levitra 20 Mg Durata Effetto Baclofene Depression Free Viagra Samples In Canada
Viaga Online cheap cialis Viagra Contra Dolor Online Generic Cialis Tadalafil
For Sale Shipped Ups Isotretinoin Acne Discount Medicine Cephalexin Picture Amoxicillin Sodium Market Report cialis Viagra Wirkung Bei Frau Keflex And High Blood Pressure Propecia Efectos 5 Alfa Reductasa

#5 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 09/10/2017, 04:37

Super Kamagra Does Walgreens Sell Cytotec How To Buy Levaquin Overseas viagra Diges Tea Cialis With Dapoxetine 80mg
Ciprofloxacin Hcl 500mg Cure Chlamydia Kamagra Gold Side Effects viagra Vidal Levitra Propecia Comprar Online Dutasteride Propecia 1mg

#6 sapedlok

sapedlok

    24 Horas

  • Usuários
  • 420 posts
  • Sexo:Masculino
  • Localidade:Veley Stream

Posted 09/10/2017, 09:30

Discounts! beauty best buy progect13.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE Sexy sweetheart neck color block bodycon women's bandage dress ( 12.20 $)Fayee FY805 Tiny Hexacopter Low Voltage Alarm 2.4G 6-axis Gyro 4CH Hovering 16.59$Cubot X16 S Android 6.0 5 inch 4G Smartphone MT6735 Quad Core 1.3GHz 3GB RAM 16GB ROM Cameras OTG GPS Bluetooth 4.0 134.59$Batman Shaped LED Night Light-14.59 $Fashionable chunky heel and fringe design women's sandals ( 31.69 $)Detachable Fishing Line Winder Reel Spool ( $5.81 )Katcenberg, DzheffriSwisswin Men Travel Backpack SWE9972 32L Outdoor backpack for mountain climbing 15.6 Computer Backpack For Business ( 90.00 $)Casual flower and zip design women's satchel ( 19.23 $)Powder Pink Suede Pump ( 157.50 $)Two Fingers Bronze Ring w2 Laps Snake ( 175.00 $)Coin purses restoring ancient ways paris memory canvas coin purses zero wallet child women change purse ( 1.42 $)Raw indian hair bundles 8~30 inches mink indian virgin hair 4 bundles deals indian straight virgin hair human remy hair bundles ( 68.11 $)New 2016 women bag canvas handbags messenger bags for women handbag shoulder bags designer handbags high quality bolsa feminina ( 43.20 $)Newest x feeling fashion gothic design women backpacks owl stylish cool black pu leather women bags ( 28.99 $) 21.jpg
Discounts! new beauty products for 2017

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
ILIFE V7 Super Mute Sweeping Robot Home Vacuum Cleaner Dust Cleaning with 2600mAh Li - battery-151.39 $
Official website of ESET NOD32 antivirus
V Kitae 18 chelovek pogibli v pozhare v massazhnom salone
Yellow Cubic Zirconia and Sterling Silver Ring ( 135.00 $)
Antique white leather unlined saddle bag ( 262.12 $) Rebecca Minkoff
7a brazilian deep curly virgin hair rosa hair products brazilian deep wave 4 bundles brazilian hair weave bundles human hair ( 53.70 $)
Charlottes Web Havaianas Light Rose Rubber Flip Flop ( 85.00 $)
Tennis club white leather sneaker ( 197.93 $) DSquared2
Retro jewelry vintage ancient bronze big eyes owl necklace kitty cat pendant statement long chain choker ( 0.22 $)
Podpolnaya imperiya
7a brazilian body wave 3 bundles brazilian virgin hair body wave yaeons hair products human hair brazilian hair weave bundles ( 24.00 $)
CRDC 25 Speed Fingle Dildo Vibrator Powerful Rechargeable Sex Products Adult Sex Toys Great for Women Female Clitoris Stimulator ( 23.38 $)
2016 12 Colors Mirror Powder Gold Pigment Ultrafine Powder Dust Chrome Piment Nail Glitters Sequins Nail Art Decorations ( 1.29 $)
Peruvian virgin hair body wave closure threemiddlefree part lace closure 7a human hair closure,peruvian virgin hair closure ( 26.25 $)
Military Camo Hard Shockproof Case For Samsung Galaxy S7 Edge S6 Edge Plus Camouflage Cover For Samsung Note 4 Note 5 J5 J7 2016 ( 4.99 $)


79.jpg
Discounts! best products inc

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Frisky tame 10 pcs bdsm bondage set leather fetish adult games sex toys for couples slave game sm product erotic toys handcuffs ( 22.28 $)
36 Colors UV Gel Builder Set For Nail Art Tips Extension Manicure DIY Tools Decorations Free Shipping ( 22.90 $)
Contact's genuine crazy horse cowhide leather men wallets fashion purse with card holder vintage long wallet clutch wrist bag ( 42.50 $)
Wholesale Clothing - Cheap Dresses, Bags, Jewelry And More Online Drop Shipping | TrendsGal.com
Hot Brand Men Women Travel Organizer Hanging Wash Toiletry Bag Make up Bag Large Capacity Multifunction Storage Bag Cosmetic bag ( 10.50 $)
Nail Art Brush Pen Rhinestone Diamond Metal Acrylic Handle Carving Powder Gel Liquid Salon Liner Nail Brush With Cap 2016 New ( 1.77 $)
Meizu EP-21HD In-ear Music Earphones with Microphone ( $8.76 )
Free shipping diy handmade balanced armatured headphone triple three 3 microdrivers earphone se535 ergonomic housing shell ( 143.10 $)
Es358 fashion simple vintage heart stud earrings wholesales factory direct sales jewelry accessories ( 0.20 $)
Ulefone Power 4G Phablet-171.73 $
Sterling Silver Cut Out Tiger Necklace ( 192.00 $)
Heart Quilted Eco Leather Small Backpack ( 184.00 $)
ZTE AXON 7 4G Phablet-532.05 $
Tiny Flexible Detachable USB Fan Low Power Consumption Silence Fan ( $1.30 )
40603 CANNI Nails Supplies Gel Nail Polish Professional Use Base Nail Gel Primer ( 2.85 $)


46bb.jpg
Discounts! best cosmetic products 2017

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Bostanten Genuine Leather Bags Ladies Real Leather Bags Women Handbags High Quality Tote Bag for Women Black Fashion Clip Hobos ( 69.99 $)
1 pc front fur cape universal seat covers car for priora avtochehol artificial color Cream-colored auto sales in 2016 ( 25.00 $)
14 5g 9cm 1pcs lot winter fishing hard bait vib with lead inside ice sea fishing ( 1.43 $)
Zolotaya malina (premiya, 1995)
Dark Blue Mini Dots Cotton Slim Fit Mens Shirt ( 47.50 $)
Mozhno ya poOru? (Video)
Fur Poncho 2016 Autumn Real Rabbit Hot Sale Triangle Knitted Women Party Pullover Lady Pashmina Wrap poncho pele de coelho ( 23.00 $)
Peruvian body wave with closure 7a peruvian human hair 3 bundles with closure peruvian virgin hair ( 22.00 $)
Fonmor 2016 New Men's bags Cowhide Leather Shoulder Bag Multiple Zipper Leisure Bag Man Cross body Travel bags ( 39.81 $)
Outdoor Hiking Camping Tools Emergency Survival Tool Set Multi-function Wildlife SOS Tool Box Travel Kit Camping Equipment Gear ( 8.00 $)
Bajron Svann Game of Thrones
High quality 2016 brand genuine leather bag vintage designer men crossbody bags cowhide leather small messenger bag for man ( 26.64 $)
Little Mix — Shout Out to My Ex (Official Video)
3 meter sweat anti-skid handle metal bearing speed skipping rope for mma boxing gym adjustable crossfit jump rope wholesale ( 11.39 $)
Discount Body - coupons and discounts in Moscow! Buy discount or coupon.


90bb.jpg
Discounts! best hair gel for men progect13.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE Ulefone Future 5.5 inch Android 6.0 4G Phablet MTK6755 64bit Octa Core 1.95GHz 16.0MP Rear Camera 4GB RAM 32GB ROM Type-C Hall Sensor Touch Sensor Miracast OTG 252.59$30 Speed Pretty Love Silicone Dual Rabbit Vibrator Waterproof G spot Dildo Vibrators Sex Product Adult Sex Toys For Women ( 21.28 $)Savannah Pink Grapefruit Saffiano Leather Small Satchel ( 195.00 $)Small preppy style candy color rucksack hotsale zipper simple women shopping bag ladies mobile bookbags student school backpacks ( 38.00 $)Walkera AIBAO 16MP CAM 4CH 6 Axis Gyro APP Virtual WiFi FPV Quadcopter 469.00$Rosa hair products brazilian virgin hair straight human hair weave 3 bundles 100 unprocessed virgin brazilian ( 45.99 $)Smit, Kavan120g 28 inch long clip in hair extensions straight hairpiece synthetic 5 clips on hair extension hairpieces 25 colors available ( 7.49 $)Assorted 7 pieceslot engraved stone pocket palm stones jade crystal reiki quartz healing chakra aventurine with free pouch ( 16.99 $)Brass and Woven Leather Large Arrow Earrings in Fumoso ( 135.00 $)Blue el glasses el wire fashion neon led light up shutter shaped glow rave costume party ( 5.68 $)Alluring spliced round neck lace women's one-piece swimwear ( 10.80 $)Hc1136 sexy tattoo stickers body art harajuku fake tattoo waterproof temporary tattoo stickers men women letter ( 0.60 $)African Blue Eyed Daisy Seeds Osteospermum seeds Cape Mix Flower Heirloom 30PCS C01 ( 0.89 $)Igri na svezhem vozduhe 44bb.jpg

#7 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 14515 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 09/10/2017, 18:35

Buy Stendra Tablets Online Pharmacy World Polarmeds Pharmacy online pharmacy Cialis Online Prices Viagra.Es

#8 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 24/10/2017, 20:03

Discount Drugs Of Canada Viagra En Ligne En France Oferta De Propecia cialis Overseas Drug Store

#9 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 05/11/2017, 12:37

Buy Clomid Online Zest Creative levitra 20mg tablets mfg gsk Acheter Priligy En Belgique Viagra Per Ansia Amoxicillin Breastfeeding Milk Supply
Clobetasol Vitiligo Usa Medicine Online With Free Shipping cialis Viagra Australia Next Day Delivery Amoxicillin Light Headed Cialis 8 Comprimes
Prix Viagra 100mg Pharmacie France Buy Zithromax Online Overnight Efectos De Cialis cialis online Ed Supplements Overnight Name Brand Cialis Without Prescription Acquistare Levitra On Line

#10 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 15724 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 28/11/2017, 10:08

Comprare Viagra Online Viagra E Effetti viagra Lean Tea
Remoxy Amoxicillin Bangledesh sildenafil tadalafil and vardenafil Fastest Shipping Generic Viagra
Real Zentel On Sale viagra Cialis Effet Forum Female Viagra Reviews Cialis Non Ha Funzionato




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq