Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does Window have a parent?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Client-side development
Title:
Does Window have a parent?
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01329830
Message ID:
01329830
Views:
51
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
Reply
Map
View

Click here to load this message in the networking platform