Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect the presence of an element
Message
De
12/12/2011 14:17:13
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01530873
Message ID:
01530881
Vues:
30
>GetElementByName and GetElementbyID work, but it gets tougher if you are using a MasterPage.

There isn't a way to detect directly if a node exists. We have to scan:
function IFrameTransactionalLoad()
{
   lcDiv=document.getElementById('DIVTransactional')

   // If we already have a child
   if (lcDiv.hasChildNodes())
   {

      // For each child node
      for (var i=0; i<lcDiv.childNodes.length; i++)
      {
         var child=lcDiv.childNodes[i];

         // If this is an element node
         if (child.nodeType==1)
         {

            // If this is the script node
            if (child.nodeName=="script")
            {
               lcDiv.removeChild(child)
               break
            }

         }

      }

   }

}
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform