Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am in a page http://www.sample.com/index.php

How can add URL query string.For ex when i click a button URL became http://www.sample.com/index.php?value=10 without page reload.by using jquery ajax function.

share|improve this question
1  
What have you tried? Anyway check the history API –  gdoron Oct 4 '12 at 11:25
add comment

2 Answers

up vote 0 down vote accepted

I think you are looking for History API, check out this history.js library, https://github.com/browserstate/history.js

Demo: http://browserstate.github.com/history.js/demo/

share|improve this answer
 
Thank you for your answer –  kathirvel Oct 4 '12 at 12:21
add comment

New HTML 5 browsers support the History API (browser support, W3C spec):

window.history.pushState(stateObj, title, url);

In a pre HTML 5 browser you can set the hash tag (browser support, W3C example)

window.location.hash = "state";

Older browsers that do not support changing of the hash tag cannot use this feature.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.