Possible innacuracy in .on() documentation #290

FrancoB411 opened this Issue Apr 30, 2013 · 0 comments


None yet
1 participant

On this page:

In this section:
Example: Attach and trigger custom (non-browser) events.

Starting on line of code 15:
$("p").on("myCustomEvent", function(e, myName, myValue){
$(this).text(myName + ", hi there!");
$("span").stop().css("opacity", 1)
.text("myName = " + myName)
$("button").click(function () {
$("p").trigger("myCustomEvent", [ "John" ]);

myValue does not seem to be used. Maybe remove it?
If the idea is to show that the custom events can pass multiple values into the handler such as $("p").trigger("myCustomEvent", [ "John", "DAN" ]);
Then maybe add a second value like DAN to the array, like in the line above, and use the myValue argument in the handler to display DAN to the screen?

Whatever the intention, Hope this helps.



dmethvin closed this in 8f055c0 May 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment