• Guest, The rules for the P & N subforum have been updated to prohibit "ad hominem" or personal attacks against other posters. See the full details in the post "Politics and News Rules & Guidelines."

help with JavaScript

slipperyslope

Banned
Oct 10, 1999
1,622
0
0
OK this is stupid because I can't see anything that I am doing wrong. here is my javascript code that is giving me problems:
<P><SCRIPT LANGUAGE=&quot;JavaScript&quot;>
var URLString = window.location;
var start = URLString.indexOf(&quot;?&quot;);
var end = URLString.length;
var userName = URLString.substring(start,end);
</SCRIPT></P>

The line that errors out is &quot;var start = URLString.indexOf(&quot;?&quot;);&quot;

I know that indexOf is a valid method. Does anyone see what is wrong with that code? I can print out the URLString and it is fine.

Jim
 

ASK THE COMMUNITY