SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Possible to get "name" from this link?

    Hi,

    When I right click on certain links, is it possible to create an option in my right click menu in Firefox that would get the "name" from this link:

    Code:
    http://www.mysite.com/test.php?name=John&tags=blah
    The name in this case is John, and have it change the link into:

    Code:
    http://test.othersite.com/testagain.php?name=John
    Im hoping this could be done in Greasemonkey for Firefox, which is I believe all in Javascript.

    Any help is very very appreciated!

  2. #2
    SitePoint Evangelist TommiChi's Avatar
    Join Date
    Oct 2008
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First i would use window.location.search to extract the entire querystring as a string expression (the only way to do it in JS), then regex the value of the name parameter out of the string


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •