javascript - Duplicate Event in Parent Window -
i have iframe on page. iframe has same origin page, shouldn't need worry cross-origin security problems.
on parent frame, have "keydown" event listener watching key presses. if iframe has focus, "keydown" events registered in iframe only.
i duplicate iframe "keydown" event on parent frame.
is possible? have been looking @ document.createevent
, evt.initevent
not there yet. also, if create "keydown" event, act user typed character? i.e., can direct them field on parent document?
if using jquery, declare wrapper function in parent trigger keydown of input element:
function triggerkeydown(){ $("#my_input").keydown(); }
in iframe, call
window.parent.triggerkeydown();
to trigger keydown event in parent window.
Comments
Post a Comment