modifying the content of the address bar without triggering apostback

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nimad

    modifying the content of the address bar without triggering apostback

    Hello,

    I would like to modify the content of the location bar (address bar)
    using JavaScript. Suppose I am at

    The followig line:
    window.location = "aaa";
    changes the content of the address bar to:


    which is fine except that it then goes ahead and causes a full
    postback to the server. How can I change the content of the location
    bar without causing a postback?

    I can also use
    location.hash=" aaa";
    this does not trigger a postback but changes the content of the
    address bar to:


    and i want


    Thanks!
  • VK

    #2
    Re: modifying the content of the address bar without triggering apostback

    On Apr 5, 9:55 am, nimad <nim...@gmail.c omwrote:
    Hello,
    >
    I would like to modify the content of the location bar (address bar)
    using JavaScript. Suppose I am athttp://localhost/WebTests/TestEvent.aspx
    The followig line:
    window.location = "aaa";
    changes the content of the address bar to:http://localhost/WebTests/aaa
    >
    which is fine except that it then goes ahead and causes a full
    postback to the server. How can I change the content of the location
    bar without causing a postback?
    >
    I can also use
    location.hash=" aaa";
    this does not trigger a postback but changes the content of the
    address bar to:http://localhost/WebTests#aaa
    >
    and i wanthttp://localhost/WebTests/aaa
    >
    Thanks!
    So like user comes to some malicious site but the script shows
    http://www.bankofamerica.com in the address bar so the user would have
    full confidence to type in his online account info? I am not saying
    that you are doing something like this: I am just explaining why no
    one browser will allow to do anything like this for obvious security
    reasons. Moreover, in IE7 and higher address bar is now enforced for
    all script-generated windows. That is another frequent question here:
    "how to remove address bar in window.open?" and the same answer: you
    cannot do it for the security reasons.

    Comment

    Working...