alessandrio
alessandrio

Reputation: 4370

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"

I want the new form is so "save.com/#jhjghgggg"

and it works.

I want a button that says generate link.

as does the "mega.co.nz" site

not know where to start

Upvotes: 0

Views: 81

Answers (2)

user4014802
user4014802

Reputation:

the button

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

javascript

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

Upvotes: 1

Arnelle Balane
Arnelle Balane

Reputation: 5487

You can have bind an event listener to your button which listens for click events on it and change the URL as a result:

the button

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

jQuery

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

Upvotes: 1

Related Questions