I have this components in my URL --
var myType="Air B&B";
var myID="RestInPeace";
var myURL="http://myhome.com?type="+myType+"&name="+myID;
alert(myURL); //http://myhome.com?type=Air B&B&id=RestInPeace
The '&' inside myType has broken your query here:
http://myhome.com?type=Air B&B&id=RestInPeace
The page relies on the id to locate the record. It won't get it because the '&' inside the type has broke the query! Any uri sensitive characters inside myType needs to treated so it won't break the query.