0

Am using Liferay 6.2 and trying to get a external page in a pop up.

Am using the following code

function ShowPopup(){

AUI().ready(function(A) {
      AUI().use('aui-dialog', 'aui-io', function(A) {
          var url1 = '/myportlet/myview.jsp';

        //  var url1 = 'www.google.com';

    Liferay.Util.openWindow(
            {
                 dialog: {
                    cache: false,
                   width: 800,
                    height: 700,
                    modal: true
                },
                  id:'myview',              
                uri: url1
         }
       );
 Liferay.provide(
       window,
       'closePopup',
        function(popupIdToClose) {
            var dialog = Liferay.Util.getWindow(popupIdToClose);
            dialog.destroy(); // You can try toggle/hide whatever You want
        },
        ['aui-base','aui-dialog','aui-dialog-iframe']
   );
       }); 
});

If I provide the first var url1('/myportlet/myview.jsp'), the popup displays properly, as it is internal link, But if I provide the second var url1('www.google.com'). The localhost url is prepended for the URI(like http://localhost:8080/www.google.com), so it is not able to display the external link in pop up. How can i make the external url display in the popup.

user3510366
  • 71
  • 1
  • 5

1 Answers1

0

If your target has different domain, you should use absolute URL including protocol - http://www.google.com.

Anyway, I think it may be hard to embed google as recently there is new trend for securing sites against iframing (and I think google has introduced these improvements). More details here How to show google.com in an iframe?.

Community
  • 1
  • 1