[Javascript] dynamic anchor tags, javascript, and JSP

Filipiak, Bob (Contractor) filipiab at atsc.army.mil
Fri Feb 15 14:44:57 CST 2002


Just a thought but it may be that once you go to the Anchor tag the browser
doesn't reload because the "#...." incdicates a location on the current
page.
Bob Filipiak
(Contractor)

-----Original Message-----
From: Jay Wright [mailto:jwright at once.com]
Sent: Friday, February 15, 2002 3:35 PM
To: 'javascript at LaTech.edu'
Subject: [Javascript] dynamic anchor tags, javascript, and JSP



I have a web application written with jsp and a controller servlet.  I have
implemented a pop up window, that when completes it's task, uses clientside
java script to refresh it's opener and close itself.

<body onload="opener.location.href='/some/page';self.close();">

This works flawlessly.  At least it seems to.

However, when I add jsp code to this page, to refresh the opener and append
a dyanmically generated ANCHOR tag, it works perfectly well the first time,
but then fails to refresh the opener on subsequent tries.

<%
        String anchorString = (String) request.getAttribute("anchor");
        StringBuffer buf = new StringBuffer("");
        if (str!=null) buf.append("#").append(anchorString);
        System.out.println(buf.toString());
%>
<body
onload="opener.location.href='/some/page<%=buf.toString()%>';self.close();">


I KNOW that anchorString is not null, because I log it and it logs
correctly.  The first time this page is executed, it correctly refreshes the
opener (/some/page#anchor1), but the other attempts all fail to refresh,
leaving "/some/page#" in the browser address window, but never refreshing
the browser.

Any ideas why this might be?

Thanks,
Jay

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20020215/e3b10218/attachment.htm>


More information about the Javascript mailing list