Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Javascript Error - "The callee (server [not server application]) is not availabl

Hey...I need help from all you experts...

Scenario -
From "a.jsp" a new window is opened("b.jsp"), From "b.jsp" , again a new window is opened ("c.jsp"). "c.jsp" has a link, that when clicked, tries to open "d.jsp" in the top most window i.e the window in which a.jsp is displayed.

Problem -
The above functionality works on my local machine. But when I try to access the JSPs through server, I get the following javascript error on clicking the link
"The callee (server [not server application]) is not available and disappeared;
all connection are invalid.The call did not execuate."

The script in c.jsp is -

function getTopMostWindowRef()
{
var topWindowRef = window.self ;
var foundTopWindow = false;
while(!foundTopWindow) {
if(isPopUpWindow(topWindowRef)) {
topWindowRef = topWindowRef.top.opener ;

} else {
foundTopWindow = true;
}
}

return topWindowRef ;
}

function linkClick(linkUrl)
{
// check if it is popup
// if yes then end open request to parent and close self.
var topMostWindowRef ;
if(isPopUpWindow(self))
{
topMostWindowRef = getTopMostWindowRef();
topMostWindowRef.top.location.href = linkUrl ;
topMostWindowRef.top.focus();
self.close();
return false;
}
else
{
return true;

}
}

function isPopUpWindow(windowObj)
{
if (windowObj.top.opener != null && windowObj.top.opener.closed != true) {
return true;
} else {
return false ;
}
}

<a href="/login.jsp" TARGET="_top" onClick="linkClick(this.href)" >Login</a>

when the check if the topmost window is popup or not is done, I get the javascript error at the line shown in bold.

How do I remove this javascript error?

Thanks in Advance :)

-Pratik
[2065 byte] By [pratik] at [2007-11-11 6:59:47]