Forum Moderators: coopster & phranque

Message Too Old, No Replies

Javascript window.open

need to pass variables with Url

         

dabrisz

5:52 pm on Dec 6, 2001 (gmt 0)

10+ Year Member



Can I pass variables from one asp page to another when using the window.open? Or is there another way?

When I used window.open the browser recieves (anypage.asp) instead of (anypage.asp?var1=1&var2=2)

volatilegx

7:52 pm on Dec 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In JavaScript, if you name the windows you can refer to the variables in another window by using the window name and variable name such as:

Var1 = originalWindowName.Var1;
Var2 = originalWindowName.Var2;

txbakers

10:39 pm on Dec 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can build your complete URL as a variable in the javascript and use that variable as the destination of the window.open method.

function opennew(url,name,fea){
newUrl = url + "?var1=" + var1 + ";var2=" + var2;
window.open(newUrl);

}