Search code examples
htmljqueryjquery-eventsecmascript-5

How to Get External Page's HTML in another Page


I have a simple HTML page to display other pages. When a request comes to the page the page internally calls to another page and views called page content.

I have tried it to be done with IFrame but IFram has width and height problem. We must specify width or height of IFrame element. Because called page width and height is unknown we can't specify width and height of IFrame.

I want to get HTML of called page and put this in div or another element to display in caller page.

Any help will be appreciated.


Solution

  • Use the JQuery load() method. Its still an IFrame in the background, but has more options.