0

Here is what I have..I am using the jquery.FrameDialog plugin. When the dialog box opens up, there are 2 buttons. One for let's say open google.com and second button to open stackoverflow.com

Problem is that the default url works fine, but using the button like this: $dialog.load("http://www.google.com"); it doesn't work. What am I doing wrong?

Here is my full code:

   $('#mydialog').click(function(){
          var $dialog = jQuery.FrameDialog.create({
          url: 'http://www.yahoo.com',
          loadingClass: 'loading-image',
          title: 'IP Tracing',
          width: 1100,
          height: 700,
          autoOpen: false,
          overlay: {
          opacity: 0.5,
          background: "black"
          },
          buttons: {
                 "google": function() {
                        $dialog.load("http://www.google.com");
                 },
                 "stackoverflow": function() {
                        $dialog.load("http://www.stackoverflow.com");
                 },
                 "Exit": function() {
                        $( this ).dialog( "close" );
                 }
          }
     });

     $dialog.dialog('open');
     return false;
     });

1 Answer 1

2

maybe there is special and comfortable interface for changing urls for this plugin, but you can always lead your code to do what you want.

$('#box').click(function(){
          var $dialog = jQuery.FrameDialog.create({
          url: 'http://www.yahoo.com',
          loadingClass: 'loading-image',
          title: 'IP Tracing',
          width: 1100,
          height: 700,
          autoOpen: false,
          overlay: {
          opacity: 0.5,
          background: "black"
          },
          buttons: [
                 {
                     text: 'google',
                     click: function() {
                            $(this).find('iframe').attr('src', "http://www.google.com")
                     }
                 },
                 {
                     text: 'Exit',
                     click: function() {
                            $(this).dialog( "close" );
                     }
                 }
          ]
     });

You can simply find an iframe and say this directly to change the url

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. That works for me as it accomplishes what my end result should be!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.