Monday 29 July 2019

javascript - How to update the URL in the address bar but without reload to that URL?

How to update the URL in the address bar but without reload to that URL?



I found 2 solutions :




Solution 1:
Read here https://stackoverflow.com/a/4059844/2642351
Using window.history.replaceState.
However, when I implement it in my angularjs project it reverts back the URL immediately ot the previous one.



Solution 2:
Read here https://stackoverflow.com/a/24102139/2642351
This works for ngRoute however, Im using uiRouter. Is there a similar solution in uiRouter?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...