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

HELP WITH PARAMETERS!!!!!!!!!!!!!!!!!! 1

Status
Not open for further replies.

gcastillo

Programmer
Jun 9, 2000
127
MX
I'm opening a new browser with data from another page. I need to send a parameter between them, but I have no idea how to do that.... When I'm opening a Details Page, it works fine, but with a new browser, the parameter does'nt work!!  Please help!!!
 
Now, I may be missing the key on this answer, but after fiddling with it for a while, you may just be able to get the parameters to pass from one browser window to another.&nbsp;&nbsp;The key is to in two parts.&nbsp;&nbsp;1.&nbsp;&nbsp;Get the windows to recognize each other by name.&nbsp;&nbsp;2.&nbsp;&nbsp;Get the proper script line to call the data from windowA.<br><br>Example:<br><br>After windowB launches, a script can call a variable stored in windowA if windowB knows the name given to windowA.<br><br>If windowA is name Jaba and windowB is name theHutt, then you have to find the script line that will call the variable out of Jaba.<br><br>I think this will work based off of the framesets.&nbsp;&nbsp;You can have one frame pull data from another because both frames are associated by a name.&nbsp;&nbsp;I have yet to figure out how to get one window to identify another by name or the code to call the variable out of that window.
 
Send parameter on the URL<br>page.htm?param=123<br><br>and on window just extract the paramm from the URL.<br><br>Here is a script I wrote for extracting querystring variables.<br><br>&lt;script&gt;<br>//Querystring variable extractor by Russ Michaels<br>//usage<br>//variable = getvalue(variable_name)<br>var url = document.location.href;<br>var start = url.indexOf('?');<br>if(start != -1)<br>{<br> var querystring = url.substring(start+1, url.length);<br> var pairs = querystring.split('&');<br>}<br>function getvalue(name)<br>{<br>var Value = '';<br>if(pairs)<br> for(a=0;a&lt;pairs.length;a++)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br> {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(pairs[a].substring(0, pairs[a].indexOf('=')) == name)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Value = pairs[a].substring(pairs[a].indexOf('=')+1,pairs[a].length);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br> }<br> return Value;<br>}<br>&lt;/script&gt; <p>Russ Michaels<br><a href=mailto:russ@satachi.com>russ@satachi.com</a><br><a href= Internet Development</a><br>For my personal book recommendations visit <br>
 
You learn something new every day.&nbsp;&nbsp;I was wondering if JavaScript had a way of storing data.&nbsp;&nbsp;Thanks, Russ.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top