0

I know it is most basic question to ask but I am struggling to get the answer for this.

I have a scenario where I need to modify a Query Parameter of a HTTP Get request that was triggered when an user clicked on a link(Anchor tag) from browser using Java script.is it possible?

  • Possible connection with http://stackoverflow.com/questions/5999118/add-or-update-query-string-parameter – Pietro Jul 05 '16 at 12:24

1 Answers1

0
  1. Bind an event handler to the link.
  2. Use preventDefault to cancel the normal behaviour so the link isn't followed.
  3. Read href to get the destination.
  4. Modify the query string (e.g. with String.prototype.replace)
  5. Assign the result to location
Community
  • 1
  • 1
Quentin
  • 800,325
  • 104
  • 1,079
  • 1,205
  • Thanks for reply Quentin.Here I need to get the http get request url when an user performs an action from the browser UI such as clicking on an link or button and add a new Query parameter to it.How to get that url? – user3170308 Jul 05 '16 at 12:42