/    Sign up×
Community /Pin to ProfileBookmark

change url via javascript

hey is there a way to change the url (parameters) via javascript…

thanks. =)

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@Stephen_PhilbinFeb 20.2007 — If you mean make the address bar say a different address from the one that the page came from, no.
Copy linkTweet thisAlerts:
@gigszauthorFeb 20.2007 — uhm.. same address but with different parameters...

say from www.someaddress.com?param1=true

to www.someaddress.com?param1=false and without reloading..

is this possible?

thnx, =)
Copy linkTweet thisAlerts:
@Stephen_PhilbinFeb 20.2007 — Oh right. Just use window.location('address_goes_here');

That'll call the page and bring your altered GET variables into effect.
Copy linkTweet thisAlerts:
@gigszauthorFeb 20.2007 — i'll try that one.. thanks. =)
Copy linkTweet thisAlerts:
@gigszauthorFeb 20.2007 — Oh right. Just use window.location('address_goes_here');

That'll call the page and bring your altered GET variables into effect.[/QUOTE]


this one reloads.. is it possible to do this without a reload?
Copy linkTweet thisAlerts:
@Stephen_PhilbinFeb 20.2007 — Certainly not that I know of. Javascript is incapable of altering what appears in the address bar for security reasons. What's so bad about reloading the page?
Copy linkTweet thisAlerts:
@ecksleyMay 26.2008 — Not to unearth an old thread, but to address your question: If you are using Flash or Ajax/jQuery such an option could be very useful.

When you change sections within a Flash piece it could call to some JS function and update the URL. This would allow for a unique bookmark for different sections of the site. When the Flash is initially loaded it can check the URL for this variable and go directly to the section associated with it.

A reload would work of course, but with Flash and jQuery able to produce beautiful/asynchronous transitions it would defeat the purpose.

Too bad there isn't a way to do this. Thanks though.
Copy linkTweet thisAlerts:
@ecksleyMay 26.2008 — This Seems like an interesting work around. Uses the old URL "#" or what I might call an anchor link to amend the URL without reloading the page.

You would then need some JS in the page to extract that value, recognize it and act accordingly when the page is revisited.

http://ajaxpatterns.org/Unique_URLs
×

Success!

Help @gigsz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...