如何加载页面到div和在浏览器的地址栏中显示的网址是什么? [英] How to load pages into divs and display their URL in the browser's address bar?
本文介绍了如何加载页面到div和在浏览器的地址栏中显示的网址是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要加载在一个特定的DIV页面。我想在浏览器的地址栏中显示的加载页面的URL。
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.
我怎么能这样做?
推荐答案
好,加载外部页面到一个div最简单的方法是使用jQuery的.load功能 - $('#div_id)的负载(' ../ url_to_page.html');
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');
至于改变地址栏,这可以用HTML5做的,但在此之前,任何你可能是出于运气。
as far as changing the address bar, this can be done with HTML5, but anything before that you might be out of luck.
HTML5例如: window.history.pushState(对象或字符串,标题,/新网址);
HTML5 example: window.history.pushState("object or string", "Title", "/new-url");
这篇关于如何加载页面到div和在浏览器的地址栏中显示的网址是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文