i'm trying to put a js window.location within my json output to update a DIV with that javascript code to redirect the user. Only problem here is that my script just doesn't do anything anymore after trying to put the javascript within the json output.
$result = array("error" => false, "html" => null);
$result["error"] = false;
$result["html"] = "<h3>Deel 1 is afgerond, <a href='/shop/?,69'>KLIK HIER</a> om door te gaan naar de begin pagina.</h3>";
$result["html"] .= "<script type="text/javascript"><!-- function Redirect() { window.location="http://www.newlocation.com"; } setTimeout('Redirect()', 10000); //--></script>";
} else {
$result["error"] = true;
$result["html"] = "<h3>Error; Neem contact op met de webmaster</h3>";
}
Now the script dies without doing anything because of this JS.
i just don't know howto format it. I tried changing the " to ' and putting \ before the " but none of it works. anybody ?
Thanks.