Events not fired when Iframe present on page
Hi, I am having problems with with event firing when an Iframe is present on the page. Once I remove the IFrame, everything works fine. Please note that the control has the focus when I press Enter key ( I read some articles that this might be the problem). I tried both in IE8 and Firefox. Here is my code:
<
html
xmlns
="http://www.w3.org/1999/xhtml">
<
head
runat
="server">
<
title
></
title
>
<
script
type
="text/javascript"
src
="/script/jquery-1.4.3.min.js"></
script
>
</
head
>
<
body
>
<
form
id
="form1"
runat
="server"
>
<
input
style
=
"
width
: 100px"
id
="target"
type
="text"
/>
<
iframe
id
="frameid"
style
="
width
:1px;
height
:1px;
z-index
:-1;
position
:absolute;
left
:-500px;
top
:-500px"/>
<
script
type
="text/javascript">
$(
document
).ready(
function
() {
$(
'#target'
).keydown(
function
(event) {
alert(event.which);
});
});
</
script
>
</
form
>
</
body
>
</
html
>