Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie variable question

Status
Not open for further replies.

tbalazs

IS-IT--Management
Dec 18, 2000
158
GB
This produces no popup although if I scrap the variable zzzz and just use <a href=&quot;javascript:popup('funchal.jpg')> it works fine. Can someone pls explain?

Thanks,
Tony.

<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=us-ascii&quot;>
<meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;>
<meta name=&quot;Generator&quot; content=&quot;Microsoft Word 9&quot;>

<script language=&quot;JavaScript&quot;>
<!--

function popup(url){
zzzz = 'funchal.jpg';
cuteLittleWindow = window.open(url, &quot;littleWindow&quot;,
&quot;location=no,width=640,height=480&quot;);
}

</script
</head>
<body>
<a href=&quot;javascript:popup(zzzz)></a>
</body>
</html>
 
your not passing you window.open a useable url.... try this:

<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=us-ascii&quot;>
<meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;>
<meta name=&quot;Generator&quot; content=&quot;Microsoft Word 9&quot;>

<script language=&quot;JavaScript&quot;>
<!--

function popup(){
zzzz = 'funchal.jpg';
cuteLittleWindow = window.open(zzzz, &quot;littleWindow&quot;,
&quot;location=no,width=640,height=480&quot;);
}

</script
</head>
<body>
<a href=&quot;javascript:popup()></a>
</body>
</html>

this should but if you want to pass a variable then use the way you found that works:

<html>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=us-ascii&quot;>
<meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot;>
<meta name=&quot;Generator&quot; content=&quot;Microsoft Word 9&quot;>

<script language=&quot;JavaScript&quot;>
<!--

function popup(url){
cuteLittleWindow = window.open(url, &quot;littleWindow&quot;,
&quot;location=no,width=640,height=480&quot;);
}

</script
</head>
<body>
<a href=&quot;javascript:popup('funchal.jpg')></a>
</body>
</html>



[conehead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top