jquery - Update title of Dialog from the source of Iframe -



jquery - Update title of Dialog from the source of Iframe -

i made dialog,iframe

var $frm = $('<iframe />').attr('id','ifrmtv'), $dialog = $('<div />').dialog({ autoopen: false, width: 'auto', hight: 'auto' });

then after info processing set $frm source , show dialog like:

$frm.attr('src', 'http/wmp.htm').appendto($dialog); $dialog.dialog({title: 'title'}).dialog('open');

i know if there way in wmp.htm code alter title of dialog. jquery_ui generate span class ui-dialog-title shouldn't accessible wmp.htm. help appreciated.

the page http/wmp.htm loading within iframe should load jquery. not necessary, create consistent when looking ui-dialog-title element.

note: read this lowercase , uppercase urls.

now, within iframe, can access parent container using window.parent and, using jquery, access element $('selector', window.parent.document). now, page load within iframe should know it's owned dialog element id, can find back. while can accomplish in various ways, i'll assume have 1 dialog iframe loading http/wmp.htm. so, should able like

var $frm = $('<iframe />').attr('id','ifrmtv'), $dialog = $('<div />').attr('id', 'dlgtv') .dialog({ autoopen: false, width: 'auto', hight: 'auto' }); //... $frm.attr('src', 'http/wmp.htm').appendto($dialog.dialog({title: 'loading...'})); $dialog.dialog('open');

and within page wmp.htm :

$('#dlgtv', parent.document).prev().find('.ui-dialog-title').html('some title');

jquery jquery-plugins

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -