I would like to know how polymer stops anchor refreshing behavior at the same domain but it does not stop when using window.location.*
.
Asked
Active
Viewed 291 times
0

MRTC
- 209
- 2
- 8
-
Welcome to StackOverflow. Please check the help menu about how to ask good questions. It's quite unclear what this question is about. – Günter Zöchbauer May 27 '16 at 05:32
-
I'm sorry for ambiguity but I'm asking for my code that when I use `window.location.href` for lets say a button `on-click`, the page is refreshing but when using anchor tag it's not so I had to wrap every button with anchor tag to achieve the desired behavior which is non refreshing – MRTC May 27 '16 at 12:34
-
Are you talking about app-router? – Günter Zöchbauer May 27 '16 at 12:36
-
no it's something like [link](http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page) and I want to know how polymer do this , to change address by JavaScript without reloading the page – MRTC May 27 '16 at 12:49
-
I'm sure Polymer doesn't do anything like that. If anchor tags only change the part after `#`, thab it's normal browser behavior that the page is not reloaded. – Günter Zöchbauer May 27 '16 at 12:52
-
but in [link](https://github.com/PolymerElements/polymer-starter-kit/blob/master/app/index.html#L85) for example. I know that the page's data is based on `data-route` but why it didn't redirect to `href` address and refresh the page Although the 'baseUrl' has no `#` – MRTC May 27 '16 at 13:08
-
Then https://developer.mozilla.org/en-US/docs/Web/API/History_API is used. – Günter Zöchbauer May 27 '16 at 13:12