javascript - Uncaught TypeError: cannot call method 'cookie' of undefined -
this question has answer here:
- switching jquery noconflict, how fix code? 3 answers
- jquery - $ not defined 34 answers
please help!!! trying set cookie not working. error message says "uncaught typeerror: cannot call method 'cookie' of undefined". dont know why saying this. had before added path , domain know not causing problem.
my code
<script src="jquery-2.0.3.js"></script> <script src="jquery-cookie/jquery.cookie.js"></script> <script type="text/javascript"> $.noconflict(); //<![cdata[ var word = "hello"; var cook = $.cookie("newar", "word", {expires: 3, path: '/', domain: 'http://localhost/test.html'}); $.cookie("newar"); document.write("step 1"); //]]> </script>
you cannot use $
access jquery methods after have said this
$.noconflict();
remove statement. means there else(library) other jquery using $` symbol , see in case there nothing that.
Comments
Post a Comment