#13781 closed bug (notabug)
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: |
Description
hi,
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 jsfiddle.net.
thanks,
Khalil
Change History (2)
comment:1 Changed 10 years ago by
Component: | unfiled → manipulation |
---|---|
Resolution: | → notabug |
Status: | new → closed |
comment:2 Changed 10 years ago by
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.
thanks
It looks like you have confused
jQuery.text
with the.text
instance method: http://jsfiddle.net/hZ9Hy/1/Regardless, we don't generally make a point of adding code to support invalid arguments.