2

http://www.usatoday.comをご覧ください。このウェブサイトは backbone.js で作成されていますが、なくても問題なく動作します。

http://phantomjs.orgのようなものを使用しているとは思いません。

誰かがどうやってそれをしたか知っていますか?

ありがとう

PS 私も今日、私にメールを送ります。彼らが答えて許可をくれたら、彼らの言うことを彼女に報告します。

4

1 に答える 1

2

They use a technique called progressive enhancement.

Essentially, this means you write the basic site without JS, and only add JavaScript on top of it later to improve the functionality.

There is nothing particularly special to it - the server simply sends the full HTML for the page which can be used to render the site instead of using Backbone to generate the markup on the fly from templates.

To be more specific about the techniques used in this case, it looks like they are generating the content mostly on the server even when using Ajax to load it.

When changing pages with JS enabled, they send the full page content markup from the server. Most likely this is done so that they can improve code reuse between the JS and non-JS versions of the site.

The HTML-block that is sent seems to contain some JSON. Most likely this is loaded for their client-side implementation so it knows what content you are currently viewing.

于 2012-11-08T08:12:39.957 に答える