SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    To change the actual URL requires a page refresh there is no way around it. You could use an AJAX form of updating the data.

    But no to change the URL in the address bar requires the page to be refreshed.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Florida
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you. I will try with Ajax then.

    Mapg

  4. #4
    SitePoint Enthusiast c.norris's Avatar
    Join Date
    Jun 2007
    Location
    Butler, PA
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you need to change the url address listed?


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
  •