Why the moveTo acces denied in jsp not in asp

C

cschang

I include this javascript file in my jsp page developed in Weblogic
8.1.4 on Windows 2000 platform. Basically, I use the makeRemote( )
function in an <a..> hyperlink to open a child window, which has the
size of window of its parent, and then overlap at the left-top corner of
the parent window. However, the function moveTo() was not working and
system displayed an error of "access denied" of that line despite the
child window was open. I have used this same javascript section in an
ASP format and it never complained. Anyone know why? Thanks.
/*
Subject: provides the common used javascript functions
*/

function makeRemote(xstrUrl)
{
var aHeight = document.body.offsetHeight*0.95;
var aWidth = document.body.offsetWidth*0.99;
var sl = window.screenLeft;
var st = window.screenTop;
var features = "width=" + aWidth + ",height=" + aHeight +
",resizable=yes,scrollbars=yes";
var remote = window.open(xstrUrl,"remotewin",features)
// remote =
window.open(xstrUrl,"remotewin","location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=1,width=640,height=480,top=20,left=20");
if (remote.opener == null) remote.opener = window;
remote.opener.name = "opener";
remote.moveTo(sl,st);
remote.focus();
}


C Chang
 
J

John C. Bollinger

cschang said:
I include this javascript file in my jsp page developed in Weblogic
8.1.4 on Windows 2000 platform. Basically, I use the makeRemote( )
function in an <a..> hyperlink to open a child window, which has the
size of window of its parent, and then overlap at the left-top corner of
the parent window. However, the function moveTo() was not working and
system displayed an error of "access denied" of that line despite the
child window was open. I have used this same javascript section in an
ASP format and it never complained. Anyone know why? Thanks.

I don't know why, but you need to understand that the browser neither
knows nor cares about JSP. When you make a request that is serviced by
a JSP, the browser gets back an HTML document (typically). The HTML may
contain Javascript, in which case the script semantics are completely
independent of the mechanism used to generate the document (JSP in this
case).

I am not as familiar with ASP, but my understanding is that it works
pretty much the same way as JSP with respect to the characteristics I
described above.

The bottom line is that if the response from a JSP does not work as you
expect in your browser, then the problem is with your JSP code (or
possibly with your browser), not with JSP as a technology. Examine the
document that your JSP produces (i.e. view the source in your browser)
to find the problem, then modify your JSP code to produce documents that
will work as you want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top