Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateElement div and close it
Message
De
20/09/2012 11:11:34
 
 
À
20/09/2012 10:47:27
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01553320
Message ID:
01553325
Vues:
39
Why not use jQuery? You won't have to walk the entire DOM. You just specify the object ID and jQuery finds it for you.

>I use this to create a div element in a window:
>
>
>loDiv=window.parent.document.createElement("div") 
>window.parent.document.body.appendChild(loDiv)
>
>
>Now, later down the code, I need to remove the div.
>
>So, I need to use something like this:
>
>
>document.body.removeChild(loDiv)
>
>
>But, this is not totally the right syntax as loDiv has been created in an IFrame inside the main window. The main window do have a variable available such as:
>
>
>loDiv=""
>
>
>So, I guess, once the appendChild() is done, I need to assign that loDiv to the loDiv of the main window. I am not sure about the proper syntax however.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform