CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    62

    Question How to restrict Url Display on Title bar

    Hello,
    i am creating one site, in which i am having two or three links. when any user clicks on that link, it's url should not be displayed in Title bar & status bar of browser. can we restrict it using server side scripting. I using Asp for server side coding.
    please tell me how to do that.

  2. #2
    Join Date
    Aug 2005
    Location
    southampton, UK
    Posts
    1,320

    Re: How to restrict Url Display on Title bar

    you cannot do this using asp / php as they are server side technologies

    i would ask the question in a javascript forum
    With sufficient thrust, pigs fly just fine. However, this is not
    necessarily a good idea. It is hard to be sure where they are going to
    land, and it could be dangerous sitting under them as they fly
    overhead. -- RFC 1925

  3. #3
    Join Date
    May 2002
    Posts
    10,943

    Re: How to restrict Url Display on Title bar

    Well, just add title tags for the first part. You can use JavaScript to change the status bar text. Call the changestat() in the onload sub of the body tag.

    Code:
    <html>
    <title></title>
    
    <script language="JavaScript">
      function changestat(){
      window.status = "";
      setTimeout("changestat()", 100);
      }
    </script>
    
    <body onload="changestat()">
    </body>
    </html>
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  4. #4
    Join Date
    May 2004
    Location
    MN / NJ, United States
    Posts
    768

    Re: How to restrict Url Display on Title bar

    As for the title bar, simply using the <title>Title here</title> tags changes the title of the page to something like:

    "CodeGuru Forums - How to restrict Display on the Title bar - Microsoft Internet Explorer"
    "CodeGuru Forums - How to restrict Display on the Title bar - Mozilla Firefox"

    using peejavery's technique, you can change the status bar text with ease. Alternatively, you can change it once the page finished loading:

    Code:
    <script type="text/javascript">
    
      onload = function() {
        window.status = "";
      }
    
    </script>
    *9-11-01* Never Forget; Never Forgive; Never Relent!
    "If we ever forget that we're one nation under God, then we will be a nation gone under." - Ronald Reagan

  5. #5
    Join Date
    May 2002
    Posts
    10,943

    Re: How to restrict Url Display on Title bar

    Quote Originally Posted by Dr. Script
    Alternatively, you can change it once the page finished loading
    Do remember that there are many sites that have scripts changing the status after moving over a link and then returns the website URL onmouseout. This is why I suggest using setTimeout().

    Dr. Script, can you move this to the Scripting Client Side forum? I think it belongs there.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  6. #6
    Join Date
    May 2004
    Location
    MN / NJ, United States
    Posts
    768

    Re: How to restrict Url Display on Title bar

    I misunderstood your script ... I had seen it as the setTimeout an attempt to avoid the error of starting the timer before page loaded which could lead in an error. I didn't notice that the function was called from the onload event handler, nor did I realize that it was a function at all ... my mistake.

    I did intend to move it ... just I apparently forgot ... thanks, done.
    *9-11-01* Never Forget; Never Forgive; Never Relent!
    "If we ever forget that we're one nation under God, then we will be a nation gone under." - Ronald Reagan

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured