Open an external page in Popup in jQuery Mobile

I am using jQuery Mobile. Actually I want to open an external link in a popup. I have 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> 

A popup window opens, the content is the text http://www.google.com/ . But I really want to download the URL. on the Google index page.

+6
source share
1 answer

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 }); }); 

I do not recommend anything to do this with the whole page, for example google.com. simpleedog cannot handle this type of content, and it will ruin your markup structure. But you can load small fragments of HTML, for example, as a list.

+1
source

Source: https://habr.com/ru/post/913614/


All Articles