faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 10 people (30%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

I need to open a new window and pass all variables after the "?" in a url. ie. default.asp?pic=2

Aug 16th, 2002 02:06
Dirk Van Caneghem, James Stubblefield,


Hi,
Suppose the actual URL of the viewed page is index.html?
testvar1=7&testvar2=8. Any URL in your page needs to get the vars? 
Here's a trick that only works in IE (I suppose)
- Give a name to the anchor:
        <A HREF="default.html" NAME="link123">All Details</A>
- Add the following script to your page:
<script language="JavaScript" type="text/javascript">
<!--
document.all.link123.href = document.all.link123.href + "?" + 
location.search.substring(1)
//-->
</script>
That's all!
Greetzzz...