Im using the iUI framework to create a site. If your not familiar with this you have one page made up of divs and you navagate the user between with fragment identifiers.
The problem with this is if your user adds content it is not visible until they refresh. In my sistuation they add data to a list via jquery post but like I say they see nothing until a refresh and once you do a refresh it goes to the parent div as the #fragment has been lost.
So I have managed to get the page to go to mywebsite.com/#_fragment after the update using window.location = mywebsite.com/#_fragment but it doesn't actually reload the page.
Anyone have any clues has how to refresh a page to a fragment?
URI fragment identifiers are client-side only, and are not sent over to the server, i.e., if you inspect the HTTP request header, you will not see #_fragment. Additionally, making changes to the URI that only modify the fragment will not trigger any DOM events.
While there are workarounds like using a setInterval() call to actively monitor the document.location.hash property, the easiest thing is to simply change the query string arg. For example, instead of:
include a query string component like:
The presence of the "?refresh=1" (or any other key/value pair) will cause the browser to make a request to the server, while preserving the #hash identifier.
See here for more info about the JS location object: http://docs.sun.com/source/816-6408-10/location.htm