Skip to main content

Bug Tracker

Side navigation

#13781 closed bug (notabug)

Opened April 16, 2013 07:18AM UTC

Closed April 16, 2013 09:05AM UTC

Last modified April 21, 2013 12:31PM UTC

Problems about `text` method of jQuery

Reported by: Owned by:
Priority: undecided Milestone: None
Component: manipulation Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:


I have a question about text method of jQuery, I know that it's a shortcut of Sizze.getText and it only accept array or element object as its argument. But I encounter one problem about it, if I pass a class or other string selector to it, it will cause an 'Uncaught RangeError' that exceeds the maximum call stack size.

I don't know whether is a bug or something else, but I think if I input the wrong arguments and at least it won't let the browser(such as Firefox) stop working.

Here is test case about it on



Attachments (0)
Change History (2)

Changed April 16, 2013 09:05AM UTC by gibson042 comment:1

component: unfiledmanipulation
resolution: → notabug
status: newclosed

It looks like you have confused jQuery.text with the .text ''[ instance method]'':

Regardless, we don't generally make a point of adding code to support invalid arguments.

Changed April 21, 2013 12:31PM UTC by KhalilCheung <> comment:2

No, I'm not confused it with the .text instance method. I have emphasised that I just had a doubt about the jQuery.text method in the ticket.

Regardless, I have got your idea. However, I also think jQuery should avoid the misoperation of users, such as that.