www.webdeveloper.com
Results 1 to 4 of 4

Thread: jQuery API question

  1. #1
    Join Date
    Aug 2010
    Location
    San Diego
    Posts
    242

    jQuery API question

    Looking at this jQuery docs page the first 2 functions are
    • jQuery.ajax()
    • .ajaxComplete()


    The first one is prefixed with "jQuery" and the second one isn't. I'm guessing those functions prefixed with "jQuery" only apply to the global jQuery, while all the other functions can apply to copies as well. True?

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    I think we're using different terminology, but it sounds like you have the right idea.

    Methods prefixed with "jQuery" are static methods. You don't need an instance of selected elements.

    $.ajax(url, settings);

    The other methods only work on instances of selected elements.

    $(selector).load(url);

    On a side note, though, it seems to me that the ajaxComplete method ought to be static. There's really no reason you should need to select elements in order to register an ajax complete callback.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  4. #4
    Join Date
    Aug 2010
    Location
    San Diego
    Posts
    242
    Aha, I'm starting to get it. I'm actually quite at home with "real" OO languages but struggling with JS. So "jQuery" acts as a class and things that it returns ($("#foo")) are instances of the class.

    Thanks much.

    Quote Originally Posted by Jeff Mott View Post
    I think we're using different terminology, but it sounds like you have the right idea.

    Methods prefixed with "jQuery" are static methods. You don't need an instance of selected elements.

    $.ajax(url, settings);

    The other methods only work on instances of selected elements.

    $(selector).load(url);

    On a side note, though, it seems to me that the ajaxComplete method ought to be static. There's really no reason you should need to select elements in order to register an ajax complete callback.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles