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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -