Reputation: 305
I am loading popup within window and and on that popup i further load another jquery dialog box.Now my my problem is that i want to update the parent window some portion of html and don't know how to do it.If not clear ask me .thanks in advance.I want to update some div with specific id.I Added the image of my working .You can see three windows.I want to update top links (My cart
) on either checkout or continue shopping button click.Hope now you got my point
Dialog box code :
jQuery("#dialog").html(data.status + ": " + data.message+"<br/><div style=' margin-top:28px; width:360px;'>
<a class='list_to_cart' href='javascript:void(0)' onClick='parent.jQuery.fancybox.close(); gotopage();' style='width:137px !important; float: left; margin-right:3px;'> Continue Shopping</a>
<a class='list_to_cart' href='<?php echo Mage::getBaseUrl();?>checkout/cart/' style='float: left; margin-left:50px;' onClick='parent.jQuery.fancybox.close(); gotocartpage();'>Checkout</a></div>");
js code where i want to update :
function gotopage()
{
document.getElementById("content").innerHTML = '12';
jQuery( '#dialog' ).dialog('close');
}
Upvotes: 1
Views: 3974
Reputation: 4331
I think you are confuse in two windows.one iframe and other one your parent window.You can access your parent elements like this:
window.parent.document.getElementById("content").innerHTML = '8';
Try, i hope it will solve your problem.
Upvotes: 1