www.webdeveloper.com
Results 1 to 7 of 7

Thread: JQuery - this.empty() is not a function

  1. #1
    Join Date
    Aug 2007
    Posts
    28

    JQuery - this.empty() is not a function

    Hi, I've been trying to figure out why Firebug is giving me the following error on this page. I'm using JQuery 1.2.6 (the gallery script i'm using on the website isn't compatible with 1.3.x) - the error is as follows:

    Code:
    this.empty is not a function
    http://www.maguiresonline.co.uk/development/ian/js/jquery.js
    Line 12
    I've not seen this error on other sites where i'm using 1.2.6 - can anyone see why this might be happening? Thanks in advance!
    Last edited by nicky77; 04-28-2009 at 04:59 AM.

  2. #2
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    It means that somewhere, you're trying to call a jQuery method on a variable that is not a jQuery object.

    So instead of this.empty() you need to do $(this).empty()
    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";

  3. #3
    Join Date
    Aug 2007
    Posts
    28
    Thanks Jeff. I've found the culprit in my galleria config script - I've changed
    Code:
    image.attr('alt', caption.text);
    to
    Code:
    image.attr('alt', this.text);

  4. #4
    Join Date
    Dec 2012
    Posts
    1
    Greetings, people of 2009.

    I come from the future to say two things:
    • By the end of 2012, this post will top the Google rankings for 'jQuery "this.empty is not a function"'.
    • A common cause for this error (probably also the cause in this case) is calling .text on a jQuery object (note no brackets/parenthesis). Either you're calling .text on the wrong thing, and meant to call it on a non-jQuery object (as in this case), or, you actually meant to call the jQuery method, .text() (note the brackets/parenthesis)


    It's jQuery that is calling .empty(), not your code.

    I will now return to 2012.

  5. #5
    Join Date
    Jul 2014
    Posts
    1
    Dear "Human" from 2012,
    Thank you very much for enlightening the future people of 2014 with your reply to this ancient post. May it also be known that calling the .html method with no parenthesis will cause this error, as this was my problem!

  6. #6
    Join Date
    Jul 2014
    Posts
    1

    How to prevent user to input special characters?

    how to prevent it?i mean, right before you enter it's already preventing you to input a special character. for example i pressed & but the textbox didn't displayed it cause it's already blocking it. thanks!

  7. #7
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,348
    There is a JQuery & Frameworks forum on this site...
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

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