The last part of the resource identifier in var


The last couple of days I’ve been working on this site: bubbles
When you enter the site, a pop-up window appears and you are asked to enter a word. When you enter a word, the word will be displayed on the website as a bubble font.
There are also a few Easter eggs, for example. when you enter "orca".

Now my question is: how can I make the last part of the link automatically be myName var? (I don’t know how to really explain this ...)
Therefore, when you go to http://van-der-noord.nl/bubbles/here , it should displayOne

And when you go to http://van-der-noord.nl/bubbles/penguin , it should display

penguins

+4
1

, URL-:

http://example.com/bubbles/#penguin

, #, "", :

window.location.hash // => "#penguin"

# slice:

window.location.hash.slice(1) // => "penguin"
+3

Source: https://habr.com/ru/post/1568035/


All Articles