views:

17

answers:

1

I am trying to use the JQuery cookie plugin in my project but I'm running into some trouble. Because I need to use the prototype library along with the JQuery library I used the JQuery.noConflict() method to assign $j as the JQuery alias. Unfortunately, even once I have loaded jquery.cookie.js into my page, $j.cookie('name','value') returns

Uncaught TypeError: Object function (selector, context){
  //The JQuery object is actually just the init constructor 'enhanced'
  return new JQuery.fn.init(selector,context);
} has no method 'cookie'
+1  A: 

It doesn't look like it is out of the box. Though, I'm sure it's possible for you to change it up a bit. Replace the instances of jQuery with '$' for instance in a block as such

(function($) {
  $.cookie = ...
})(jQuery);

I don't see why that wouldn't work, but I have no idea. I'm just speculating ;)

theIV
Just solved my own problem, apparently I downloaded it wrong... Thanks for the answer.
Teddy