spacefem
11-09-2003, 09:54 AM
I know you all get tons of questions on variable passing, but I seriously can't get this thing to work!
The deal: on one page, I have this:
<script language="JavaScript" SRC="http://spacefem.com/oftheday/code1.js?ted=5"></SCRIPT>
Then I have a file called code1.js that says this:
var ted = location.search.substr(1).split("&")
document.write(ted);
document.write("<hr>");
Now, the <hr> is working, and if I do a var ted=8 or whatever it writes it, but it can't get the variable to the URL. I tried different variations of that location.search... even tried totally leaving it out... but nothing worked. I think it's because I'm referring to a source file, there isn't really a "location" to look at. so how's it supposed to get the variables?
Thanks for your help!
The deal: on one page, I have this:
<script language="JavaScript" SRC="http://spacefem.com/oftheday/code1.js?ted=5"></SCRIPT>
Then I have a file called code1.js that says this:
var ted = location.search.substr(1).split("&")
document.write(ted);
document.write("<hr>");
Now, the <hr> is working, and if I do a var ted=8 or whatever it writes it, but it can't get the variable to the URL. I tried different variations of that location.search... even tried totally leaving it out... but nothing worked. I think it's because I'm referring to a source file, there isn't really a "location" to look at. so how's it supposed to get the variables?
Thanks for your help!