1

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

4

3 に答える 3

3

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.

于 2009-11-02T08:30:21.460 に答える
0

その他のオプションには、AJAX または JavaScript の実装が含まれます。

たとえば、AJAX を使用すると、ページをリロードせずに要素 (DIV など) に動的情報を読み込むことができます。

他の JavaScript 機能の使用についても同じことが言えます。たとえば、リンクに関連付けられた onclick イベントを介して、ページ上の要素を隠したり表示したりします。

マーティンが上で述べたように、この種の機能は間違いなく悪い習慣であると考えられています。基本的に、ユーザーまたは検索スパイダーが探しているあらゆる種類のサイト構造を殺します。

于 2009-11-02T14:12:27.270 に答える
0

簡単な iframe の例 (デモ):

<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/"></iframe> 
  </body>
</html> 

他の人がすでに述べているように、これは悪い習慣です。

于 2009-11-02T14:29:25.667 に答える