How can I load an external page (ex: http://www.google.pt) to a div in my page?
I’ve tried html5 like this:
document.getElementById(id).innerHTML = "<iframe src='http://www.google.com' height='100%' width='100%'></iframe>";
but it doesn’t load.
When I put a page from my domain, it properly loads.
How can I load an external page (from another domain) ?
There are some cross-domain restrictions because of which you cannot load any external site directly into an iframe on your page.
However you can try the following jQuery plugin for making cross-domain AJAX requests;
https://github.com/padolsey/jQuery-Plugins/blob/master/cross-domain-ajax/jquery.xdomainajax.js