Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] dynamic anchor tags, javascript, and JSP


  • From: javascript@xxxxxxxxxx (Jay Wright)
  • Subject: [Javascript] dynamic anchor tags, javascript, and JSP
  • Date: Fri, 15 Feb 2002 12:52:10 -0800

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1B662.A3146E80
Content-Type: text/plain;
	charset="iso-8859-1"

 
That makes sense to me.  If thats true, is there a way to force a refresh of
the opener location?  With the ultimate goal of refreshing to that anchor?
 

-----Original Message-----
From: Filipiak, Bob (Contractor) [mailto:filipiab@xxxxxxxxxxxxx]
Sent: Friday, February 15, 2002 12:45 PM
To: 'javascript@xxxxxxxxxx'
Subject: RE: [Javascript] dynamic anchor tags, javascript, and JSP




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@xxxxxxxx <mailto:jwright@xxxxxxxx> ] 
Sent: Friday, February 15, 2002 3:35 PM 
To: 'javascript@xxxxxxxxxx' 
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@xxxxxxxxxx 
https://lists.LaTech.edu/mailman/listinfo/javascript
<https://lists.LaTech.edu/mailman/listinfo/javascript>  


------_=_NextPart_001_01C1B662.A3146E80
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>RE: [Javascript] dynamic anchor tags, javascript, and JSP</TITLE>

<META content="MSHTML 5.00.3315.2870" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=968465120-15022002></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=968465120-15022002>That 
makes sense to me.&nbsp; If thats true, is there a way to force a refresh of the 
opener location?&nbsp; With the ultimate goal of refreshing to that 
anchor?</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
  <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Filipiak, Bob (Contractor) 
  [mailto:filipiab@xxxxxxxxxxxxx]<BR><B>Sent:</B> Friday, February 15, 2002 
  12:45 PM<BR><B>To:</B> 'javascript@xxxxxxxxxx'<BR><B>Subject:</B> RE: 
  [Javascript] dynamic anchor tags, javascript, and JSP<BR><BR></DIV></FONT><BR>
  <P><FONT size=2>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.</FONT></P>
  <P><FONT size=2>Bob Filipiak</FONT> <BR><FONT size=2>(Contractor)</FONT> </P>
  <P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From: Jay 
  Wright [<A href="mailto:jwright@xxxxxxxx";>mailto:jwright@xxxxxxxx</A>]</FONT> 
  <BR><FONT size=2>Sent: Friday, February 15, 2002 3:35 PM</FONT> <BR><FONT 
  size=2>To: 'javascript@xxxxxxxxxx'</FONT> <BR><FONT size=2>Subject: 
  [Javascript] dynamic anchor tags, javascript, and JSP</FONT> </P><BR><BR>
  <P><FONT size=2>I have a web application written with jsp and a controller 
  servlet.&nbsp; I have</FONT> <BR><FONT size=2>implemented a pop up window, 
  that when completes it's task, uses clientside</FONT> <BR><FONT size=2>java 
  script to refresh it's opener and close itself.</FONT> </P>
  <P><FONT size=2>&lt;body 
  onload="opener.location.href='/some/page';self.close();"&gt;</FONT> </P>
  <P><FONT size=2>This works flawlessly.&nbsp; At least it seems to.</FONT> </P>
  <P><FONT size=2>However, when I add jsp code to this page, to refresh the 
  opener and append</FONT> <BR><FONT size=2>a dyanmically generated ANCHOR tag, 
  it works perfectly well the first time,</FONT> <BR><FONT size=2>but then fails 
  to refresh the opener on subsequent tries.</FONT> </P>
  <P><FONT size=2>&lt;%</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String anchorString = 
  (String) request.getAttribute("anchor");</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuffer buf = new 
  StringBuffer("");</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (str!=null) 
  buf.append("#").append(anchorString);</FONT> <BR><FONT 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  System.out.println(buf.toString());</FONT> <BR><FONT size=2>%&gt;</FONT> 
  <BR><FONT size=2>&lt;body</FONT> <BR><FONT 
  size=2>onload="opener.location.href='/some/page&lt;%=buf.toString()%&gt;';self.close();"&gt;</FONT> 
  </P><BR>
  <P><FONT size=2>I KNOW that anchorString is not null, because I log it and it 
  logs</FONT> <BR><FONT size=2>correctly.&nbsp; The first time this page is 
  executed, it correctly refreshes the</FONT> <BR><FONT size=2>opener 
  (/some/page#anchor1), but the other attempts all fail to refresh,</FONT> 
  <BR><FONT size=2>leaving "/some/page#" in the browser address window, but 
  never refreshing</FONT> <BR><FONT size=2>the browser.</FONT> </P>
  <P><FONT size=2>Any ideas why this might be?</FONT> </P>
  <P><FONT size=2>Thanks,</FONT> <BR><FONT size=2>Jay</FONT> </P>
  <P><FONT size=2>_______________________________________________</FONT> 
  <BR><FONT size=2>Javascript mailing list</FONT> <BR><FONT 
  size=2>Javascript@xxxxxxxxxx</FONT> <BR><FONT size=2><A 
  href="https://lists.LaTech.edu/mailman/listinfo/javascript"; 
  target=_blank>https://lists.LaTech.edu/mailman/listinfo/javascript</A></FONT> 
  </P></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C1B662.A3146E80--