How to popup a dialog in another frame using jquery-ui -


i'm creating small web page using jquery-ui-1.8 having frameset , 3 frames.

<frameset id="mainframe"cols="25%,*,25%">      <frame  id="f1" src="test.php"></frame>      <frame id="f2" src="test2.php"/>     <frame  /> </frameset> 

then have added button test.php file loaded @ first frame (f1) , div test2.php loaded @ second frame.

<div id="testdiv"> test 2</div> 

then need pop jquery dialog "testdiv" on second frame (f2) when click on button in f1.

i tried following solutions given @ these threads. [1] - display jquery dialog in parent window

var $jparent = window.parent.jquery.noconflict(); var dlg1 = $jparent('#testdiv'); dlg1.dialog(); 

and [2] - jquery ui dialog display inside frame, bookmarklet?

var frame = window.frames[1]; var div = $(frame.document.getelementbyid("testdiv")); div.html("my popup contents"); div.dialog(); 

but non of these pop ups dialog within second frame. can 1 please me solve problem.

just make test way, maybe not best way can try it. (attention: don't forget add attribute -> name="f2" <- on iframe f2)

in test.php:

<button onclick="parent.f2.$('#testdiv').dialog('open');">test</button> 

in test2.php:

<link type="text/css" href="jquery-ui.css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery-ui.js"></script> <script type="text/javascript"> $(function() {    $( "#testdiv" ).dialog({     autoopen: false    }); }); </script>  <div id="testdiv"> hello world! </div> 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -