tags:

views:

71

answers:

3

hello, I hope that it's okay to ask this question here. As a complete beginner i was wondering how some websites url addresses don't change when you click on an internal link. So if for example the url is www.mysite.com it remain exactly that if you clicked on the "contact" link of that site for example. Also when i go to my site it changes to www.mysite.com/home.html but some other site remain www.mysite.com.

Thanks for any help Steven

+3  A: 

The probably just use frames or iframes. The outer frame on www.example.com stays in place while the inner frame points to www.example.com/home or whatever.

Greg
Please consider that doing so is bad practice, as it prevents unsavy users from bookmarking subpages, which is frustrating and will result in less visitors over time.
Martin Hohenberg
It also doesn't work when search engines direct people to pages inside the site.
David Dorward
A: 

Other options include AJAX or JavaScript implementations.

For instance, with AJAX you can load dynamic information into an element (such as a DIV) without causing the page to reload.

The same can be said of using other JavaScript functionality, for instance hiding and showing elements on the page via an onclick event attached to a link.

As Martin said above, this sort of functionality is definitely considered to be bad practice. You essentially kill any sort of site structure that either a user or search spider will be looking for.

espais
A: 

Simple iframe example(demo):

<html> 
  <head> 
    <title>CNN</title> 
    <style type="text/css">       
      html, body, iframe {
        margin: 0px;
        padding: 0px;
        height: 100%;
        width: 100%;
        border: none;
        overflow: hidden; }
      iframe { overflow: auto; }
    </style> 
  </head> 
  <body> 
    <iframe src="http://www.cnn.com/"&gt;&lt;/iframe&gt; 
  </body>
</html>

As others have already stated this is a bad practice.

Kalmi