Solved

Possible to change URL parameters thru Javascript without refreshing?

Posted on 2008-06-24
3
6,365 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now