I have a page () with some user information in the side and small thumbnail in the side. What it's doing now is linking to a whole different page and the sidebar reloads as well. I was wondering if it was possible to change the image, ments section, the caption, as well the URL so if the user wants to link to it anywhere.
This might not be possible - but if it is I don't even know where to begin Googling this or even starting to prehend how this will work.
All answers are appreciated! Links and source code would be nice too.
I have a page (http://myflashpics./picture/p9e0) with some user information in the side and small thumbnail in the side. What it's doing now is linking to a whole different page and the sidebar reloads as well. I was wondering if it was possible to change the image, ments section, the caption, as well the URL so if the user wants to link to it anywhere.
This might not be possible - but if it is I don't even know where to begin Googling this or even starting to prehend how this will work.
All answers are appreciated! Links and source code would be nice too.
Share Improve this question edited Apr 24, 2011 at 4:28 iosfreak asked Apr 24, 2011 at 4:07 iosfreakiosfreak 5,23811 gold badges62 silver badges102 bronze badges 1- Sure... Never really worked with it so I have no clue. – iosfreak Commented Apr 24, 2011 at 4:27
4 Answers
Reset to default 3In browsers that support HTML5, you can use window.history.pushState
to perform AJAX partial loading of pages and still pletely change the URL of the page. This is what GitHub uses (see some more info as well as a video demonstrating the technique at their blog post, The Tree Slider). There is some great info on the subject on the Dive Into HTML5 History API page.
On browsers that don't support HTML5, you either must use location.hash
(if you want linkable URLs) or else don't use AJAX (and stick with your current implementation). I am in the camp that uses jQuery for this task.
sounds like a situation for
- jQuery history plugin
- jQuery.ajax() – jQuery API
In short, you can't change the URL without reloading the page but you can use AJAX to load new data ad if the page had changed. You can also track history by changing anything after the "#" in the address bar. A good example of a site that implements this is grooveshark.
You can do this simply using ajax. If you need to change the urls change the location.hash
property using Javascript.