Side navigation
#14324 closed bug (notabug)
Opened September 03, 2013 02:45AM UTC
Closed September 10, 2013 07:54PM UTC
jquery.trigger will make a looped calling
Reported by: | aiqunfang@163.com | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
there will cause a looped calling in show method.
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <script type="text/javascript" src="jquery10.js"></script> <script type="text/javascript"> function MyType() { var this$ = $(this), times = 0; this.show = function () { times++; this$.trigger("show", this); // will make a looped calling, should i use "onshow" for type name of event? but type name for click of html element is "click" $("#btn").val(times); // invalid, it is not 1 } } </script> </head> <body> <input id="btn" type="button" value="show" onclick="new MyType().show();" /> </body> </html>
there is a copy http://jsfiddle.net/mqBtA/3/
Attachments (0)
Change History (1)
Changed September 10, 2013 07:54PM UTC by comment:1
resolution: | → notabug |
---|---|
status: | new → closed |
As documented: http://api.jquery.com/trigger/