Quickly define the file lines limit and cut the first lines

Use this command if you want to keep only a certain number of the most recent lines in the file without using an additional file.

Replace:
* yourFileName – your filename
* 200 –¬†the number of lines you want to keep

 

Updating address bar with new URL without hash or reloading the page

Updating address bar with new URL without hash or reloading the page example:

 

You can then use window.onpopstate to detect the back/forward button navigation: