Results 1 to 5 of 5

Thread: Script for address bar

  1. #1
    Join Date
    Jan 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Script for address bar

    I am looking for a script to show a default address in the address bar. For example, I want my visitors to see www.dynamicdrive.com only even if they are in www.dynamicdrive.com/forums.
    Please visit http://www.dslwebserver.com/ and browse through the website keeping an eye on address bar and you will know what I am talking about.
    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I'm not sure why you would want that, as it just confuses your visitors as to where they are right now within your site. But to answer your question, this is usually done by using frames, so you have a two rows frames set up as your main index page, where the top row has a height of 0 (and hence invisible). As page changes in the bottom frame, the address remains the same, as the master frame itself remains on the index page.

    For a frames tutorial, see here.

  3. #3
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Just use the blow code: change yoursite.com to your site's index page url:


    <html>
    <head>
    <title>xyz</title>
    <script language="JavaScript">
    if(top.frames.length > 0)
    top.location.href=self.location;
    </script>
    </head>
    <frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
    <frame name="conr_main_frame" src="http://yoursite.com">
    </frameset>
    <noframes>
    <body>

    </body>
    </html>

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Or you can use Ajax.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Feb 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hmm, either I've got my frames set up wrong, or the script in the wrong place...

    Does that script go into the "index.html" that builds the frameset, or would it go into the html page that loads into the top frame?


    The http://www.dslwebserver.com/ example is the behaviour I am looking for as well...

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
  •