Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Possible to change URL parameters thru Javascript without refreshing?

Posted on 2008-06-24
3
Medium Priority
?
6,372 Views
Last Modified: 2010-05-18
I've got a page that has a few url parameters. There's a couple of modes the page can be entered in, with correspondingly different urls params. Also with the same page many of the processes are done thru AJAX without page refresh. My problem is that the AJAX updates makes the URL params old. Is there a way to update the URL parameters thru AJAX so the URL always stays current? I don't want to refresh the page because it'll defeat the AJAX feature of the page. Is this possible?
0
Comment
Question by:bemara57
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 82

Assisted Solution

by:hielo
hielo earned 600 total points
ID: 21857113
>>Is there a way to update the URL parameters thru AJAX so the URL always stays current?
The url params of what? The current/main page? If that is what you are referring to, the instant you change the location.href, you will essentially "refresh" the current page. If you are referring to the page you are submitting the request to, then yes, you can change the params as needed. If you are calling some function, pass the parameters through the function and update the url within the function.
0
 
LVL 22

Expert Comment

by:neeraj523
ID: 21858512
hello

You cant change the URL or querystring runtime (on fly) without page refresh.. instead you should try to update varaibles in your page which is reading values form querystrings and passing these to redirection pages.. you can change these varaible values in between before going to second page..

Hope it will make sense ..

neeraj523
0
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 1400 total points
ID: 21858571
Hi bemara57,
Probably you can try window hash object to resolve your cases.

Here is the sample how to use the mentioned - right click and view the source code there:
http://www.mikage.to/jquery/jquery_history.html#3

Note: You need to download the js files that provide in the articles that given above.
<script type="text/javascript" src="jquery-1.1.1.js"></script>
<script type="text/javascript" src="jquery.history.js"></script>


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question