Skip to main content

Bug Tracker

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: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

there will cause a looped calling in show method.

<!DOCTYPE html>
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="jquery10.js"></script>
    <script type="text/javascript">

        function MyType() {
            var this$ = $(this), times = 0;
   = function () {
                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

    <input id="btn" type="button" value="show" onclick="new MyType().show();" />

there is a copy

Attachments (0)
Change History (1)

Changed September 10, 2013 07:54PM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

As documented:

Note: For both plain objects and DOM objects other than window, if a triggered event name matches the name of a property on the object, jQuery will attempt to invoke the property as a method if no event handler calls event.preventDefault(). If this behavior is not desired, use .triggerHandler() instead.