I need to append '?key=val1' to the current url which is
www.mysite.com/web/test.html
and this I can do using:
window.location.href+'?key=val1' resulting in www.mysite.com/web/test.html?key=val1
I now need a way to modify val1 to val2, if I do:
window.location.href+'?key=val2' results in www.mysite.com/web/test.html?key=val1?key=val2
but I need: www.mysite.com/web/test.html?key=val2
There are ways to break down the url but wanted to know if there is
anything jQuery already provides. Thanks!
On May 1, 1:22 pm, waseem sabjee <waseemsab...@gmail.com> wrote:
> ok so you wanna edit the URL ?
>
> var url = "www.google.co.za";
> top.location = url;
>
> this will send the page towww.google.co.za
>
> var url top.location;
>
> this shoud retrieve the URL
>
> Sorry. I'm unable to fully answer your question at this time.
>
> On Fri, May 1, 2009 at 10:17 PM, buntu <buntu.w...@gmail.com> wrote:
>
> > Hi,
>
> > I need to append a parameter string like: '?key=val' to the current
> > url and the value for the key changes based on the user input. Is
> > there any jquery utility that does the base url extraction from
> > window.location, so that I can append the '?key=val' to that?
>
> > Thanks for the help!
No comments:
Post a Comment