Skip to content

Instantly share code, notes, and snippets.

@johnsardine
Created January 3, 2014 10:44
Show Gist options
  • Save johnsardine/8236046 to your computer and use it in GitHub Desktop.
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
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