[jQuery] Problem with popup windows in jquery
Hi, I'm trying to use jquery to modify some events in a popup window
(window.open). Here's what I did;
var popup = window.open('Example.html',
'Example',
'height=400,width=300,top=100,left=100');
$(popup.document).ready(function() {
$("#widget-area a", popup.document).click(function() {
alert("Clicked!");
});
});
And here's the stripped down html code of the page:
<form method = "post" id = "myForm" onsubmit="return handleWidget();">
Select a Widget:
<div class = "widget-area">
<a href = "#" >Click Me</a>
</div>
<input type="submit" value="Submit"/>
</form>
The popup window shows up, but the click event doesn't work (doesn't
show the alert)... If I only use this:
$(popup.document).ready(function() {
alert("Ready!");
});
It properly shows the message. The problem is with $("#widget-area a",
popup.document).click(function() { ... });
Thanks for your help,
João Portela