View Full Version : Script for address bar

01-07-2006, 08:10 PM
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.

01-08-2006, 09:29 AM
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. (http://www.javascriptkit.com/frame1.shtml)

02-02-2007, 05:34 AM
Just use the blow code: change yoursite.com to your site's index page url::) :)

<script language="JavaScript">
if(top.frames.length > 0)
<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">
<frame name="conr_main_frame" src="http://yoursite.com">


02-03-2007, 05:29 AM
Or you can use Ajax.

02-04-2008, 09:47 PM
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...