Newsgroup: it.comp.lang.javascript
Titolo: New Window Problem

Hi All,
I am working on the following URL
http://www.investorevolution.com/new/
When one of the links on the Right hand side e.g., FTSE100 is clicked a new
window pops up displaying a graph.
I am trying to add a refresh link to this but for some reason I can't write
to this window.
Does anybody know how to do this? Or why I can't seem to write to it?
Note I posted this question on Sunday but I don't think their where that
many of you around, so apologies if you have already read this.
Cheers
Mark

 ha scritto nel messaggio
news:39a0...@news.server.worldonline.co.uk...

Hi!
It watches that here it is monday!!!!
 joke!
Here the code............
<script language="javascript">
<!--
function refresh()
{
  var doc =
window.open("","displayWindow","toolbar=no,width=400,height=300,directories=
no,status=no,scrollbars=yes,resizable=yes,menubar=no").document;
  doc.clear();
  doc.write("<title>your_title</title>");
  doc.write("<body bgcolor='#ffffff' link='#000080' topmargin=0
leftmargin=0>");
  doc.write("<td align=right><INPUT TYPE='button' VALUE='Refresh ' NAME='B1'
onClick='location.reload()'></A></td>");
  doc.write("</body>");
  doc.close();
  }
  //-->
</script>
____________________
andreotta fabiano
WebMªster ATI POWER s.n.c.
andr...@atipower.it
http://www.atipower.it
http://www.afdsoftware.freeweb.org
____________________

To atipower,
I used the code you sent me, however the problem is that I also need to
include the content from 
http://www.investorevolution.com/images/dowpage.htm
. This is the hard bit because when ever I try to write to the new window
the info from the URL above is overwritten.
Please help.
function tmt_winLaunch(theURL)
{
  var doc =
window.open("theURL","displayWindow","toolbar=no,width=400,height=300,direct
ories=no,status=no,scrollbars=yes,resizable=yes,menubar=no").document;
  doc.clear();
  doc.write("<title>your_title</title>");
  doc.write("<body bgcolor='#ffffff' link='#000080' topmargin=0
leftmargin=0>");
  doc.write("<td align=right><INPUT TYPE='button' VALUE='Refresh ' NAME='B1'
onClick='location.reload()'></A></td>");
  doc.write("</body>");
  doc.close();
  }
This is where the function is called:
 <p align="center"><map name="FPMap0"> <area
href="javascript:tmt_winLaunch('
http://www.investorevolution.com/images/dowp
age.htm')" coords="1,3,53,19" shape="rect">
Cheers
Mark


It must include in this way in document also the page...
<script language="javascript">
function tmt_winLaunch()
{
  var doc =
window.open("","displayWindow","toolbar=no,width=500,height=400,directories=
no,status=no,scrollbars=yes,resizable=yes,menubar=no").document;
  doc.clear();
  doc.write("<title>your_title</title>");
  doc.write("<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0'>");
  doc.write("<table border='1' width='470'><tr>");
  doc.write("<td width='482' align='center' bgcolor='#CCCCFF'><a
href='
http://adforce.adtech.de/?adlink|2.0|43|21789|1|1|ADFORCE;loc=300
;'
target='_blank'><img
src='
http://adforce.adtech.de/?adserv|2.0|43|21789|1|1|ADFORCE;loc=300
;'
border='0'></a></td>");
  doc.write("</tr><tr>");
  doc.write("<td width='482' align='center' bgcolor='#CCCCFF'><img
border='0'
src='
http://chart.neural.com/servlet/GIFChart?sym1=$INDU&amp;height=250&amp
;
width=468&amp;cbcku=ffffcc&amp;cbckl=ffffcc&amp;cbckd=cccc99&amp;ctxtu=blu&a
mp;ctxtd=blu&amp;ctxtl=blu&amp;csym1=blk&amp;cbckg=cccc99&amp;cind7a=red&amp
;cind7=dgrn&amp;avg1=0&amp;avg2=0&amp;source=SP&amp;dres=min&amp;ignore=1220
003125'></td>");
  doc.write("</tr></table>");
  doc.write("<td align=right><INPUT TYPE='button' VALUE='Refresh ' NAME='B1'
onClick='location.reload()'></A></td>");
  doc.write("</body>");
  doc.close();
  }
  </script>
If you want reload an automatic rifle you replace the line of  <body> with
.........
doc.write("<body leftmargin='0' topmargin='0' marginwidth='0'
marginheight='0' onLoad='setTimeout('location.reload()',10000)'>");
for reload every 10 seconds........
