Created
January 3, 2014 10:44
-
-
Save johnsardine/8236046 to your computer and use it in GitHub Desktop.
When triggering events on selected elements on another context, events are not triggered. see solution below
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var context = top.window; | |
// Instead of this | |
var target = jQuery('#'+data.target, context.document); | |
// Do this | |
var target = context.jQuery('#'+data.target); | |
target.val(data.value).trigger('change'); | |
// The event will be triggered properly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment