Solved

Possible to change URL parameters thru Javascript without refreshing?

Posted on 2008-06-24
3
6,367 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
3 Comments
 
LVL 82

Assisted Solution

by:hielo
hielo earned 150 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 350 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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 …
This article discusses how to create an extensible mechanism for linked drop downs.
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…

860 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