samedi 9 septembre 2017

Check if current URL contains hash

Using Javascript how do you check if current URL contains an hash?

In test page I want to add a Javascript code to print:

<p>yes, there is a hash here</p>

if hash is present (current page http://ift.tt/2jdEQkP) or:

<p>no, there is no hash here</p> 

if hash is not present (current page http://ift.tt/1sKoNp8).

Aucun commentaire:

Enregistrer un commentaire