Your code is missing a closing parenthesis, not sure if that's the problem, line numbers in error messages aren't always decipherable. I would have used the location.search property and the switch construct:
Code:
var sSearch = location.search;
var iIndex = sSearch.indexOf("country=");
if (iIndex > -1)
{
var sCountry = sSearch.substr(9); //Test this!!!
var sLink;
switch(sCountry.toLowerCase())
{
case "lebanon":
sLink = "iframe1.aspx";
break;
case "jordan":
//other countries.
}
parent.location.href = sLink;
}
}
The script tag should also use type="text/javascript" rather than the deprecated language attribute.
--
Joe (
Microsoft MVP - XML)