Javascript Variables Passed Through URL

Beau

Lifer
Jun 25, 2001
17,730
0
76
www.beauscott.com
You could just use PHP to insert the value of the variable that was passed through:

<script language=JavaScript><!--
var strVariable = <?php
print($variable);

?>;
//-->
</script>
 

Superwormy

Golden Member
Feb 7, 2001
1,637
0
0
Arg, only its on a CGI page that frickin I can't edit and PHP won't parse stuff on that. It's GOTTA be pure Javascript.

 

Superwormy

Golden Member
Feb 7, 2001
1,637
0
0
Above script gives errors:

Line: 35
Character: 1
Error: Object doesn't support this property or method.
Code: 0


Whoppee!

Line 35 btw is: var pos = pairs.indexOf('=');


Using IE 5.0