Monday, 15 August 2011

Jquery Cookie plugin and redirect -



Jquery Cookie plugin and redirect -

i have next code works dosent perform expected:

$(".switch_org").click(function(e){ var id = $(this).attr('id'); var orgid = id.split("_"); e.preventdefault(); $.cookie('current_organisation', orgid[1], { expires: 1, path: '/' }); window.location.replace("index.php"); });

the cookie set works fine page not redirected index.php reloads same page. doing wrong? there additional step can add together redirect index.php?

thanks

don't utilize window.location.replace, straight assign value

window.location

or

windows.location.href

jquery cookies jquery-cookie

No comments:

Post a Comment