6

I'm using jQuery Mobile. Actually i want open an externl link in a popup. I tried this.

<a href="#" id="dialoglink"  data-rel="dialog">Open Dialog</a>
<script>
$(document).delegate('#dialoglink', 'click', function() {
    $(this).simpledialog({
        'mode' : 'blank',
        'prompt': false,
        'forceInput': false,
        'useModal':true,
        'fullHTML' : 
            'http://www.google.com/'
    })
});
</script>

It is opening a popup the content is the text http://www.google.com/. But i actually want to load the url. i.e google index page.

Arasu
  • 2,078
  • 6
  • 40
  • 67

1 Answers1

1

You can do this with an ajax request:

$.get('http://url.to.load.net',function(data) {
    $(this).simpledialog({
        'mode' : 'blank',
        'prompt': false,
        'forceInput': false,
        'useModal':true,
        'fullHTML' : data
    });  
});

Nothing to recommend though, to do this with a whole page like google.com. simpledialog can't handle this type of content and it would destroy your markup structure. But you can load small pieces of HTML, like a list-view.

daniel.auener
  • 1,276
  • 2
  • 12
  • 17