js中jquery加载或带有html结构的json
我正在尝试创建像 facebook 这样的功能,其中的事情只是从 ajax 运行,不需要再次重新加载网站。无论如何,我想知道 Facebook 是如何做到的,这样我就可以像他们一样做到,他们做得非常快。
他们是否使用 jQuery('#phto_area').load('#photo_with_comment); 或者
他们首先获取 json 格式的数据,然后在其上实现 html 代码,我不知道他们这样做。
im trying to create functionality like facebook, where things just run from ajax, no need to reload site again. anyway i want to know how facebook does it, so i can do it like them, they are very fast at it.
do they use jQuery('#phto_area').load('#photo_with_comment);
or
do they first get the data in json format and then implement html code on it, which i dought they do this way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Facebook 拥有一个基于开源堆栈的相当复杂的架构。他们已经发布了他们修补的开源程序的所有修改代码,以及他们修改的新服务器。
为了回答您的问题,将页面流式传输给您并严重依赖 ajax 调用。为您提供洞察力的最佳链接是: http://www.facebook.com/notes/facebook-engineering/bigpipe-pipelined-web-pages-for-high-performance/389414033919
我建议您订阅他的Facebook 工程页面,让您深入了解 FB 的内部结构。
在这里查看他们发布的修改和开源程序:http://developers.facebook.com/opensource/
Facebook has a quite complex architeture based on open source stack. They have released all the code of the modification for the open source program that they patched, and the new servers that they have modified.
To reply to you question, the stream the page to you and heavily rely on ajax call. The best link that gives you an insight is this: http://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919
I'll suggest you to subscribe to his Facebook Enginering Page, that gives you an insight in the internals of FB.
Check here for the modification and open source programs that they have released: http://developers.facebook.com/opensource/