L
ldan
Hi everybody,
I would not consider myself an expert in javascript - but so far
whatever I know, helped me reaching my goals. Recently I started to
experience a lot of javascript errors related to opening up a popup
window in an application I wrote.
The error messages are quite diverse: "Object doesn't support this
property or method" or "Unspecified error." or "The callee (server [not
server application]) is not available and disappeared; all connections
are invalid. The call did not execute.". They all occur in same
function "openPopup".
All my clients use Windows XP and IE6 and they have popup blockers
turned off; also there is no other software installed (like search
toolbars, etc) that I know of. Some of them told me that after
restarting the computer the problem goes away for a while. It's not
consistent and it's not experienced constantly even on the same
computer.
The function is trying to re-use same popup window every time. I will
post below the code:
//*** CODE Begin ***
var refPopupWindow = null;
// ........
function openPopup(aUrl) {
if (refPopupWindow) refPopupWindow.close();
refPopupWindow =
window.open(aUrl,'refPopupWindow','left=0,top=0,toolbar=0,menubar=0,dependant=1,location=0,scrollbars=1,resizable=1,width=500,height=300');
if ((refPopupWindow) && (typeof(refPopupWindow) == 'object') &&
(refPopupWindow.focus))
refPopupWindow.focus();
else
alert('Unable to open popup window');
}
//*** CODE End ***
The errors are usually thrown for lines that either are closing or
trying to focus on window. I don't know if this is the best way of
opening a re-usable popup window or if this is the "recommended" way of
coding it.
Any suggestions, critics or any other ideas would be appreciated - It's
been quite a while and I cannot figure this one out.
Thanks,
Dan
I would not consider myself an expert in javascript - but so far
whatever I know, helped me reaching my goals. Recently I started to
experience a lot of javascript errors related to opening up a popup
window in an application I wrote.
The error messages are quite diverse: "Object doesn't support this
property or method" or "Unspecified error." or "The callee (server [not
server application]) is not available and disappeared; all connections
are invalid. The call did not execute.". They all occur in same
function "openPopup".
All my clients use Windows XP and IE6 and they have popup blockers
turned off; also there is no other software installed (like search
toolbars, etc) that I know of. Some of them told me that after
restarting the computer the problem goes away for a while. It's not
consistent and it's not experienced constantly even on the same
computer.
The function is trying to re-use same popup window every time. I will
post below the code:
//*** CODE Begin ***
var refPopupWindow = null;
// ........
function openPopup(aUrl) {
if (refPopupWindow) refPopupWindow.close();
refPopupWindow =
window.open(aUrl,'refPopupWindow','left=0,top=0,toolbar=0,menubar=0,dependant=1,location=0,scrollbars=1,resizable=1,width=500,height=300');
if ((refPopupWindow) && (typeof(refPopupWindow) == 'object') &&
(refPopupWindow.focus))
refPopupWindow.focus();
else
alert('Unable to open popup window');
}
//*** CODE End ***
The errors are usually thrown for lines that either are closing or
trying to focus on window. I don't know if this is the best way of
opening a re-usable popup window or if this is the "recommended" way of
coding it.
Any suggestions, critics or any other ideas would be appreciated - It's
been quite a while and I cannot figure this one out.
Thanks,
Dan