specify jQuery for UNL template

Information and discussion on Javascript.

Moderators: rcrisler1, saltybeagle

specify jQuery for UNL template

Postby s-schakra3 » Tue May 25, 2010 5:59 am

I'm sure this has been covered somewhere on the forum but couldn't find it :(

So to include jQuery in my js file I need to do this right?


Code: Select all

WDN.jQuery(function($){

     [color=red]$[/color]("#sortable1").sortable({ connectWith: '.connectedSortable' }).disableSelection();

});



So I get the error $ in red as $ is not a function. I'm using jquery ui.

Test site: http://nmc-server1.unl.edu/sourabh_eval4/

Thanks a bunch !
s-schakra3
 
Posts: 7
Joined: Sat Oct 04, 2008 2:52 pm

Postby saltybeagle » Tue May 25, 2010 8:39 am

You can always use WDN.jQuery(...) instead of $(...), or, you can pass the dollar sign into the ready() callback, and use $ within that anonymous function. To do so, you would use:
Code: Select all
WDN.jQuery(document).ready(function($){

    $("#sortable1").sortable({ connectWith: '.connectedSortable' }).disableSelection();

});
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin

Thanks !

Postby s-schakra3 » Tue May 25, 2010 8:44 am

that did it !

Sourabh
s-schakra3
 
Posts: 7
Joined: Sat Oct 04, 2008 2:52 pm

Postby smeranda » Tue May 25, 2010 2:43 pm

jQueryUI is also available in your /wdn directory in case you want to use it: /wdn/templates_3.0/scripts/plugins/ui/
Seth Meranda
User Experience Architect
University Communications
(402) 472-8513
seth@unl.edu
smeranda
 
Posts: 111
Joined: Tue Apr 05, 2005 2:34 pm
Location: University Communications


Return to Javascript

Who is online

Users browsing this forum: No registered users and 2 guests

cron