简体   繁体   English

更改为其他网址。 简单地逐个改变不同

[英]change to a different url. Simple to change one by one different

you just want to change my url address. 你只想改变我的网址。

if I have "save.com/newdocumente.html" 如果我有“save.com/newdocumente.html”

I want the new form is so "save.com/#jhjghgggg" 我希望新表格是“save.com/#jhjghgggg”

and it works. 它的工作原理。

I want a button that says generate link. 我想要一个按钮,说明生成链接。

as does the "mega.co.nz" site 和“mega.co.nz”网站一样

not know where to start 不知道从哪里开始

You can have bind an event listener to your button which listens for click events on it and change the URL as a result: 您可以将事件侦听器绑定到按钮,该按钮侦听其上的单击事件并更改URL作为结果:

the button 按钮

<input type="button" id="the-button" value="Generate Link" />
<!-- or whatever your button is -->

jQuery jQuery的

$('#the-button').on('click', function(e) {
  location.href = 'http://the.new.location.here';
});

the button 按钮

<button id="the-button">"Generate Link" </button>

javascript JavaScript的

document.getElementById('the-button').onclick=function(e){
    document.location.hash = '#newStash';
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM