html - javascript equivalent of anchor href -
let's webpage http://localhost/myapp/route/index.html
if click on:
<li><a href="#secondpage">go second page</a></li>
it change route http://localhost/myapp/route/index.html#/secondpage
without reloading.
now i'm trying same thing onclick , javascript instead of anchor tag. because need first before let angular router change template.
<li><a onclick="myfunction()">payroll run history</a></li> myfunction(){ [... stuff ...] //change http://localhost/myapp/route/index.html#/secondpage without reloading page }
to set anchor property:
location.hash = "#/secondpage";
Comments
Post a Comment