This post is related to the one here :
http://groups.google.com/group/jquery-ui/browse_thread/thread/a940cd3e515f24e6/7a15f4f0bcb6a315#7a15f4f0bcb6a315
In my above example, I noticed that when the Dialog widget adds HTML
elements to the DOM in order to create the Dialog box, it does it
relative to the current document and not the window's document. As a
result, the HTML gets appended to the body of the HTML in the Iframe
and not in the parent of the Iframe. Therefore, my guess would be that
this is not possible unless the UIDialog itself is aware of which
document to append itself to. Can someone confirm this please?
Thank you
Akshay
On Sep 9, 11:33 am, Finesse <[EMAIL PROTECTED]> wrote:
> I have an HTML page which contains a tree control on the left pane and
> an IFrame on the rest of the page. Based on what I select on the tree
> control, I update the content of the iframe. I am writing some error
> handling code in which I am wrapping the jquery ajax object with error
> handling such that if any error occurs, I want to display a dialog
> with the error message sent from the server. The HTML page looks like
> the following :
>
> <html>
> <head />
> <body>
> <div id='leftPane'></div>
> <div id='pageContent'>
> <iframe src='MyPage' />
> </div>
> <div id='topDialog' />
> </body>
> </html>
>
> Then I am extending the jquery object to create a prompt
> functionality. What it basically does is that it will check for a
> "topDialog" div tag which exists in the main HTML page. If it can find
> it (because the IFrame was loaded in a separate window) it will use
> the "dialog" div that exists in the iframe's html content.
>
> $.extend($.fn, {
> Prompt: function(o) {
> var dialog = $
> (window.parent.document).find('#topDialog:first');
> if (dialog.length == 0){
> dialog = $('#dialog:first');
> }
> dialog.each(function(){
> $(this).addClass('flora');
> $(this).attr('title', o.title);
> $(this).html(o.text);
> $(this).dialog({
> modal: true,
> stack: true,
> buttons: o.buttons,
> close: o.close
> });
> });
> }
>
> });
>
> Then I do something like :
>
> $.ajax({
> url: myurl,
> success: onSuccess,
> error : function(XMLHttpRequest, statusText, error){
> $(this).Prompt({
> title: "HTTPRequest Error!",
> text: statusText
> });
> }
>
> });
>
> The problem that I am having with this is when the Iframe content
> makes an ajax request and the server throws an error, the dialog is
> being shown inside the Iframe and not inside the main page, even
> though it called dialog() on "topDialog" instead of "dialog".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---