hey people i’m using a jquery plugin for creating cookies which seems to be working perfect when i run it on localhost but when I tested in the server it’s not working as i expected.
below is my file testcookie.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="3.ico">
<script type="text/javascript" src="js/iepngfix_tilebg.js"></script>
<script src="js/jquery-1.4.2.min.js"></script>
<script src="js/jquery.cookie.js"></script>
<script>
(function($) {
$(document).ready(function() {
$.cookie("example", "foo");
alert( $.cookie("example") );
});})(jQuery);
</script>
</head>
<body>hello there</body>
</html>
result= no alert
here’s the demo
http://namadda.com/demo/testcookie.php
onething i noticed just now is that click view source and all the script link is working but jquery.cookie.js isn’t showing up, instead i’m getting error 406 when i clicked jquery cooke link on view source page. But it’s present on server like other plugins.
The best solution is renaming jquery.cookie.js file to something like jquery_cookie.js
It was the best solution for me, because I don’t have permission to modify mod_security