javascript - Dynamicaly change the URL and id of a body via a link without refreshing page -


i trying dynamically change url displayed user , change id of body without refreshing page. function require similar flickr.com when click on image, pop-up appears. id of body has word appended it, , url of website has word appended it.

an example be:

http://www.flickr.com/photos/orangeacid/459207903/ there image there, if click on image url changes follows: http://www.flickr.com/photos/orangeacid/459207903/lightbox/ (this new page overlaying old one)

before clicking on link body tag follows:

document.body.classname = [document.body.classname, 'js'].join(' ');

... after clicking on picture changes to:

document.body.classname = [document.body.classname, 'js'].join(' ');

...

flickr uses yahoo's yui library , talking lightbox component, , history utility.

there no all-in-one function, have build yourself, using library.

note url : html5 adds new history api allows javascript change url (pushstate) without reloading page , without using "hash" hack. it's available in webkit (chrome, safari) since while , in firefox 4. using history yui implementing this.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -