English 中文(简体)
仅在浏览器地址栏上添加 URL [重复]
原标题:just add url on only address bar of browser [duplicate]
This question already has answers here:
Closed 11 years ago.

Possible Duplicate:
Change the URL in the browser without loading the new page using JavaScript

我只需要在浏览器的地址栏 note: 不想要重定向

e.i 我有一个url www.example.com/index.html

我想在地址栏上设置 URL, 如 www.example.com/index/ page2. html

i 使用 document. place.hash = foo;

but it is add only # data like www.example.com/index.html#foo

note : 我不想重定向, 只想要在地址栏中添加 URL, 所以不要回答文档。 位置像 那样 。

有什么解决办法吗?

问题回答

请在这里阅读。

http://badassjs.com/post/8408446392/place-hash-is-die-long-lip-html5-pushstate

也许能帮上忙

window.history.pushState( abc , "Title", "/new-url");

无法完成。 这是一个安全特征, 使得更难打打一个网站( 例如, 用于钓鱼攻击) 。

我不确定你能不能不用改变方向 来完成这个任务

不过,这是实现你目标的方法

创建 页面 www.example.com/index/page2.html , 该页面包含 的框架 www.example.com/index.html

www.example.com/index.html 中,如果www.example.com/indexample.html 不在框架之内,则用户将重新定向为www.example.com/index.html





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签