On the webpage I have iframe, in which I display some content.
I want to run a function if any key is pressed inside iframe (iframe is editable).
I can do it using ajax (with scriptmanager on page):
Sys.UI.DomEvent.addHandler(document.getElementById('iframe1').contentWindow.document, 'keyup', iframeKeyHandler);
But I want to do it without ajax!
Updated Code:
function Init() {
document.getElementById('iView').contentWindow.document.designMode = "on";
document.getElementById('iView').contentWindow.document.onkeyup = function(event) {
alert(event);
}
}
<body onload="Init()" >
<iframe id="iView" style="width: 434px; height:371px" ></iframe>
</body>