0

I want to load pages in a specific div. I want to display the URL of the loaded page in the browser's address bar.

How I can do that?

mjk
  • 2,443
  • 4
  • 33
  • 33
MD.MD
  • 708
  • 4
  • 14
  • 34
  • I don't believe you can. You can load a pages content into an iFrame. Other than that you could scrape a site's content and drop it into the div using something server side like PHP. Updating the address bar though with the url I believe is out of the question. – War10ck Feb 04 '14 at 20:57

3 Answers3

1

well, the easiest way to load an external page into a div is by using the jquery .load function - $('#div_id').load('../url_to_page.html');

as far as changing the address bar, this can be done with HTML5, but anything before that you might be out of luck.

HTML5 example: window.history.pushState("object or string", "Title", "/new-url");

Chris Brickhouse
  • 650
  • 5
  • 15
0

With my knowledge there are two possibilities to load another website into a div:

First one would be to change the div's content via Ajax.

Second one would be to integrate an <iframe></iframe> into the div, in order to load the desired page in the iframe.

Hope I could help.

Robin
  • 1,208
  • 8
  • 17
0

If your trying to change the entire url displayed, domain and all, I don't believe you can and for good reason. I'd hate for you to create a phishing site of stackoverflow or otherwise and pretend to be legit while you steal my password. But managing anything after the domain is doable as answered above (or below, wherever it is by now~).

Thanks!