cookies - Uncaught Error: Syntax error, unrecognized expression: jquery -
in site, using value stored in cookie displayed once site opened, whenever site opened iam replacing window.location url stored in cookie. shows uncaught error, when refresh site error gone , redirects url in cookie. code:
var url=$.cookie("lasturl");//getting url cookie window.location.replace(url);//replacing window.location
this error iam getting:
`uncaught error: syntax error, unrecognized expression: #page2?aid=322952&artistid=322952&id=334945`
this cookie set:
var lasturl= window.location.hash; $.cookie("lasturl", lasturl);
what have done wrong in this????
var url = $.cookie("lasturl"); //getting url cookie window.location.replace(url); //replacing window.location
the replace
method of location requires url, giving hash.
Comments
Post a Comment