I have the following code which works but dosent perform as 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 is set which works fine but the page is not redirected to index.php it just reloads the same page. Am I doing something wrong? Is there an additional step I can add so that it does redirect to index.php?
Thanks