Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does Window have a parent?
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Client-side développement
Titre:
Does Window have a parent?
Versions des environnements
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01329830
Message ID:
01329830
Vues:
52
Hi everybody,

My colleague has a function that starts with
var pBlk=parent.document.getElementById('spnStat');
    if(!pBlk||pBlk.InnerHTML.match("Edit")) {
Actually, I tried to change it a bit, I added InnerHTML on the second line (it was originally
var pBlk=parent.document.getElementById('spnStat').InnerHTML;

The page can be called from one page, that has spnStat element or it can be called using window.open method in JavaScript. In the second case I'm getting a JavaScript error 'not an object'.

My question is - would the calling object be called parent in this case or as my colleague told me it would be called opener. If that's the case, how can I modify the above code to avoid an error? I can probably put this in try/catch block, but is it the only solution?

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Répondre
Fil
Voir

Click here to load this message in the networking platform