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

Passing along data through websites 2

Status
Not open for further replies.

magicandmight

IS-IT--Management
Aug 27, 2004
77
US
Is there a way to set a character combination on either a link or a drop down list that can be forwarded onto the next page so that javascript command can commense from the previous decision?
 
And thus I ask an inevitable question: how do you pass it through the url string? Ive seen it before but never have thought about it. Any support documents that you know of?
 
Code:
<a href="thenextpage.html?mycoolvariable=stuff">Click Me</a>

then, on the next page...

Code:
<script type="text/javascript"><!--

function doSomethingSpectacular() {
    var splitAtEqual;
    var theWholeUrl = document.location;
    var splitAtQMark = theWholeUrl.split("?");
    if ( isArray( splitAtQMark ) ) {
        splitAtEqual = splitAtQMark[1].split("=");
    }
    if ( isArray( splitAtEqual ) ) {
        alert( splitAtEqual[0] + " equals " + splitAtEqual[1] );
    }
}

//--></script>

and

Code:
<body onload="doSomethingSpectacular();">

*cLFlaVA
----------------------------
[tt]your mom goes to college[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top