SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot ant1832's Avatar
    Join Date
    Apr 2002
    Location
    Tucson, AZ
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there anyway to remove a variable from the address

    If i have a url that is formatted like so

    http://www.test.com?v=1
    is there anyway I can use javascript to change that url to
    http://www.test.com
    Anthony

  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you just want to remove the ?v=1 for some reason you can just do:

    var newUrl = oldUrl.substring(0, url.indexOf("?"));

    but Im not sure exactly how you are using it so Im just guessing here


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
  •