22 October, 2010

draggable() is not a function, jQuery is not defined

Sheesh! As a jQuery noob, I'd been battling with this seemingly simple problem: I was getting these two errors in Firebug, though had only paid attention to the first for some time (draggable not a function). I spent ages stuffing around with my code and eventually realised that jQuery, too, was not defined. There are no end of ideas out there about everything from DOCTYPES to incorrect script paths. This wasn't the case.
After sifting through a lot of twaddle, I finally found the (as suspected, very simple) answer on this forum. Simply, the order in which you load your scripts is important ie: jquery-ui depends on jquery, so load jquery first! Thanks to rwhitbeck .

2 comments:

  1. Thanks a bunch. I've been looking everywhere for this answer...everyone has extremely complicated answers that didn't work. This did

    ReplyDelete
  2. Hi Mark,
    Yes, I know what you mean.
    Glad this was helpful.
    Cheers,
    Gary

    ReplyDelete