creating elements in parent window
I've encountered strange problem which I can't solve.
I have a main window in which there is a link opening popup. In newly opened window there are links that allow to insert some HTML with form elements ( button) in the parent window document.
The problem is when user closes popup window the added button is inactive (action assigned to it doesnt work) What is more the problem exists in IE, in FF code works quite well.
The code inserting new elements to parent window is below.
-
var wrapper = $("<div>");
var html=$('<li><a href="'+url+'">'+title+'</a>(<span>'+cat+'</span>)<input style="display:none;" type="checkbox" name="product_attach:list" value="'+url+';'+cat+'" checked="checked"/></li>');
var button=$('<input type="button" value="usun" class="remove_attach" />');
html.append(button);
wrapper.append(html);
var attach_list = $("#assigned_attachments:checkbox",window.opener.document);
$("#assigned_attachments",window.opener.document).append(wrapper.html());
$("#assigned_attachments.remove_attach",window.opener.document).bind("click",function(){
window.opener.$(this).parent().remove();
});