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

Script not working in Firefox 1

Status
Not open for further replies.

AndyApp

Programmer
Joined
Dec 20, 2001
Messages
259
Location
GB
Can someone tell me why this script isn't running properly in Firefox yet it does in IE:

Code:
var s = "";
var queryString = window.location.href.substring((window.location.href.indexOf('?') + 1));
var array1 = queryString.split('&'); // Each array element is in format "fieldname=value"
for(var i = 0; i < array1.length; i++){
 var tempArray = array1[i].split('='); // Separate fieldname and value
 eval(tempArray[0] + " = \"" + tempArray[1] + "\"");
}
document.write("length=" + s.length);
if (s.length==0)
{
	s = "lcd";
	alert(s);
}
Works fine in IE, but in FF it doesn't set s to anything, it just leaves it blank.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top