了解Facebook和Gmail中的页面来源 [英] Understanding The Page Sources in Facebook and Gmail

查看:148
本文介绍了了解Facebook和Gmail中的页面来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设计了几年的网站。我已经熟悉了一些更先进的功能,如PHP框架和AJAX。那就是说,每当我看到流行的网站(如Facebook和Gmail)后面的页面来源时,我都会抓住我的头,因为他们看起来没有像我自己教过的那样。它充满了javascipt东西。即使像GE和亚马逊这样的大公司也有可理解的页面来源。我确定这是与流行网站上有如此多的服务器请求有关的事情。



我一般都会喜欢:


  1. 为什么流行的网站如Facebook和Gmail看起来不像
    正常网站?更具体地说,HTML似乎在JavaScript脚本中,并且css类名称和ids看起来像随机字符(后一个功能对于Gmail尤其如此)。

  2. 哪里可以获得一般的这些技术的概述。我从来没有遇到任何说明他们的材料。

也许我们可以专门面对Facebook和Gmail,不要这样做太一般了。

解决方案

Facebook主要使用 OpenSource 软件,你可以看看他们。


更具体来说,HTML似乎是内部的JavaScript脚本和css类的名称和ID看起来像随机字符。


Google使用这些随机字符,可能是因为每个人都很难尝试克隆它/理解它?



Facebook使用普通的类名。他们的HTML在脚本中,在(称为)小册子中,您可以阅读他们的这里



此外,还有一个很好的关于高可扩展性的博客


I've been designing websites for a couple years now. I've become quite familiar with some of the more "advanced" features such as PHP frameworks and AJAX.

That said, whenever I look at page sources behind popular sites like Facebook and Gmail, I scratch my head because they look nothing like what I've taught myself. It's full of javascipt "stuff". Even big companies like GE and Amazon have comprehensible page sources. I'm sure it's something to do with the fact there are so many server requests that go on in popular websites.

I would love to know, generally speaking:

  1. Why do popular websites like Facebook and Gmail look nothing like "normal" websites? More specifically, the HTML seems to be inside javascript scripts and the css class names and ids look like random characters (that latter feature is especially true for Gmail).
  2. Where can one get a general overview of these technologies. I've never come across any materials that illustrate them.

Perhaps we can speak specifically to Facebook and Gmail so not to make this question too general.

解决方案

Facebook mostly use OpenSource software, you can take a look at them.

More specifically, the HTML seems to be inside javascript scripts and the css class names and id look like random characters.

Google uses these random characters, probably because it's hard to everyone to try to clone it/understand it?

Facebook uses normal class names. Their HTML is in scripts, in (called) pagelets, you can read about them here

Also, there's a nice blog about HighScalability

这篇关于了解Facebook和Gmail中的页面来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆