Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modify browser URL without refresh page

    Hi All,

    I would like to ask if it is possible to modify some part of the browser URL without refresh page in the OnClick event over a form or link inserted in the HTML code.

    Currently I use ...
    Code:
    if (blah == blah) {
          window.location.href = window.location.href.replace(/\&ni\=on/ig, '');
    }
    But this force to refreshing.

    I want to remove "&ni=on" without refresh page as I mentioned.

    Is it possible? Any idea is welcome.

    Thank you in advance.

    Mapg

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    The only part of the URL you can change without causing the refresh is the hash.

    window.location.hash = "foo";

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New Coder
    Join Date
    Jul 2004
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you Eric.

    Best,

    Mapg


  •  

    Posting Permissions

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