In the following function if for example params[3] = "Pkg=Burlap Sack" the var Pkg will be assigned as "Burlap" and the function will break.
Code:
function Init(){
try
{
var page = location.href.split(/\?/);
var params , pair;
params = page[1].split(/&/);
CustID=params[0].replace("CustID=","");
MenuItem=params[1].replace("MenuItem=","");
ProdID=params[2].replace("ProdID=","");
Pkg=params[3].replace("Pkg=","");
alert(Pkg)
Sze=params[4].replace("Sze=","");
alert(Sze)
Flv=params[5].replace("Flv=","");
alert(Flv)
Dsc=params[6].replace("Dsc=","");
alert(Dsc)
Inf=params[7].replace("Inf=","");
alert(Inf)
Ech=params[8].replace("Ech=","");
alert(Ech)
Shp=params[9].replace("Shp=","");
PassStr="Panel.asp?CustID="+CustID+"&MenuItem="+MenuItem+"&ProdID="+ProdID+"";
}
catch(e)
{
}
ImgStr="http://www.webmaster-talk.com/images/Products/"+ProdID+".png";
document.images[0].src=ImgStr;
}
could it have something to do with charset?
Last edited by Sleeping Troll; 06-17-2008 at 10:04 AM..
Reason: More info
|