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!

Url and JavaScript in adress bar?

Status
Not open for further replies.

NJDrew

Technical User
Dec 21, 2001
31
US
Hi everyone, my question is kind of simple. Can you goto a page and use javascript in the same url so to speak? For example:
Code:
 [URL unfurl="true"]http://www.google.com[/URL] javascript:alert("Hello");

I ask because I have a page that based off of user action gets populated via javascript functions. Alot of times I link to content on that page in various forums, so I would like to be able to provide a link to the page w/ the javascript: to populate it with the correct content. Anyone know how to correctly code this?

Thanks, Drew

"Mistakes are the portals of discovery"
James Joyce
 
If you're using a popup:
Code:
HWND = window.open("mypage.htm");
HWND.execScript("alert('hi');");
If you're reusing the main window, take advantage of the search feature to pass the JavaScript params.
Code:
<a href="mypage.htm?someVar=someVal&otherVar=OtherVal">Click me</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top