Skip to Content
JAVASCRIPT網頁應用程式設計
book

JAVASCRIPT網頁應用程式設計

by Alex MacCaw
January 2013
Intermediate to advanced
332 pages
5h 23m
Chinese
GoTop Information, Inc.
Content preview from JAVASCRIPT網頁應用程式設計
76
|
第四章
由於 Twitter 採用的轉址方式是暫時轉址(302)而非永久轉址(301),因此出現在搜尋
結果裡的網址,會是有加上雜湊值的版本(也就是動態 JavaScript 程式的版本:
http://
twitter.com/#!/maccman
)如果你的網址沒有準備靜態版本,至少也可以在伺服器接收
到帶有
_escaped_fragment_
參數的網址請求時,回傳一段 HTML 格式或純文字格式的
訊息。
在你實作了 Ajax 爬行規格之後,可以利用 Fetch as Googlebot 這套工具(
http://www.google.
com/support/webmasters/bin/answer.py?hl=en&answer=158587
)試驗一下。雖然不實作這
份規格,網頁仍然會被加進搜尋引擎的索引,但十之八九沒辦法以正確的型式呈現。不
過相信像 Google 這類的搜尋引擎,以後遲早會讓他們的爬行器具備解讀 JavaScript 程式
的能力,屆時就不需再用到這份爬行規格了。
使用 HTML5 的歷史瀏覽記錄 API
歷史瀏覽記錄 APIHistory API)是 HTML5 規格的一部分,它可以把瀏覽器目前網址
置換為任意網址。也可以在瀏覽器的歷史瀏覽記錄裡新增網址(讓程式能支援瀏覽器的
「上一頁」鈕)。這種做法和設定網址雜湊值一樣,重點都在於不讓瀏覽器重新載入網
頁—好讓我們能保留所有狀態。
目前各家瀏覽器的支援情形:
Firefox >= 4.0
Safari >= ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

初めてのJavaScript 第3版 ―ES2015以降の最新ウェブ開発

Ethan Brown, 武舎 広幸, 武舎 るみ
PHP编程:第4版

PHP编程:第4版

Kevin Tatroe, Peter MacIntyre
Strange Code

Strange Code

Ronald T. Kneusel
Perfecting Your Thinking Skills

Perfecting Your Thinking Skills

MIT Sloan Management Review

Publisher Resources

ISBN: 9789862766811