I have been using the below code, to create a cookie, this works completely fine in all the browsers except INTERNET EXPLORER.. it gives the below error when i click on create cookie button.
Error
Message: '$' is undefined
Line: 4
Char: 2
Code: 0
URI: http://localhost/js/scripts.js
Code
<p>Click on the <strong>Set Cookie</strong> button below to create the testing cookie.</p><br>
<button style="color: black" input type="button" onclick="set_cookie(<?php echo "'".$set_cookie_url."'" ?> );" <?php if(isset($_COOKIE["cookieid"])) { ?> Disabled <?php } ?>value='Set Cookie'><b>Set cookie</b></button>
JS Code
function set_cookie(url){
$.get( url, { cookieid: "628929", projectid: "1" }, set_cookie_complete);
$('body').modal('show') ;
}
function set_cookie_complete(){
location.reload();
}
function unset_cookie(url){
$.get( url, { cookieid: "628929", projectid: "1" }, unset_cookie_complete);
$('body').modal('show') ;
}
function unset_cookie_complete(){
location.reload();
}
can anybody help me to get rid of this error and set the cookie