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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters with .js sheets

Status
Not open for further replies.

daph

Programmer
Jun 9, 2000
65
CA
Hey guys,<br><br>I've been using .js sheets for my web pages and they work great...until I try to pass some parameters in them. For instance, I wanted to put a function to open a new window, that I can re-use in my pages. In my .js sheet, I had a function that ressembles the following:<br><br><br>function new_window(address) <br>{ <br>&nbsp;&nbsp;winvar = window.open(address, &quot;New page&quot;, scrollbars=1, status=1, menubar=0, resizable=1, location=0, toolbar=0&quot;);<br><br>}<br><br>And in my html I had:<br><br>&lt;a href=&quot;javascript: new_window('a.html');&quot;&gt;Open&lt;/a&gt;<br><br>Could you help me find out what I'm doing wrong? And can we pass certain parameters with these .js files like we would do in javascript? <br><br>Thank you so much :)<br><br>daph<br>
 
I am not exactly sure what your problem is, but external JS files work just like JS files, they are JavaScript.<br><br>you might try something to this effect, I am not exactly sure:<br><br>fucntion new_window(address+&quot;.html&quot;)<br><br>....<br><br>&lt;a href=&quot;javascript:new_window('a');&quot;&gt;Open&lt;/a&gt;<br><br>Don't know if that will work, never have really needed to open new windows that much.
 
Thank you for the fast response...I'll try that...Appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top