[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 783
  • Last Modified:

JQuery UI Ajax Dialog Box, Is it posisble for new content to load within the dialog box ?

What I mean by this is :  once the dialog box has opened and a link is clicked within box it will bring the content into the full page rather than been contained within the dialog box.

You can see a working example here.. if you click "giftwrap this item" the dialog box pops up. If you then click add to cart within the dialog the whole page refreshes.

http://pa.creatico1.co.uk/pp/Capri/Nubuck_Olive_240.html

The code I am using is below is it possible for it to refresh within the dialog?


           <a class="ajax" href="http://pa.creatico1.co.uk/products1.asp?category=GiftWrap&product={partno}"> gift wrap this album?</a>              
           

 <script type="text/javascript">
    $(function (){
        $('a.ajax').click(function() {
            var url = this.href;
            var dialog = $('<div style="display:hidden"></div>').appendTo('body');
                       
            // load remote content
            dialog.load(

                url,  
                {},
                function (responseText, textStatus, XMLHttpRequest) {
                    dialog.dialog({width:950, height:800});
                }
            );
            //prevent the browser to follow the link
            return false;
        });
    });
    </script>
 
0
alexealden
Asked:
alexealden
  • 2
1 Solution
 
Sudaraka WijesingheWeb Application ProgrammerCommented:
Hi,

Instead of using a DIV as you dialog body, you can use an IFRAME. Then you can submit for or click links in the IFRAME and make them load in the IFRAME instead of the main window.

Check out this http://elijahmanor.com/webdevdotnet/post/jQuery-UI-Dialog-w-Resizable-iFrame.aspx
0
 
alexealdenAuthor Commented:
That was exactly what I was after thank you again!
0
 
Sudaraka WijesingheWeb Application ProgrammerCommented:
Glad to help. Thanks for the points.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now