实在是太多了阿贾克斯坏事?坏事、太多了、阿贾克斯

由网友(特别告白)分享简介:我正在开发一个网站,一个客户端JavaScript框架(道场/ dijit的)的时刻。如同所有的JavaScript / framworks你开始使用Ajax来进行快速调用和更新。我的问题是有经验时用于链接使用Ajax和一般规则?我只问,因为我似乎可以用Ajax的更多的则没有,我很担心,在初始页面的任何错误可能会传播给...

我正在开发一个网站,一个客户端JavaScript框架(道场/ dijit的)的时刻。如同所有的JavaScript / framworks你开始使用Ajax来进行快速调用和更新。我的问题是有经验时用于链接使用Ajax和一般规则?我只问,因为我似乎可以用Ajax的更多的则没有,我很担心,在初始页面的任何错误可能会传播给其他元素。或者与内容得到不断更换的东西可能会出问题。

I'm developing a site with a client side javascript framework (dojo/dijit) at the moment. As with all javascript/framworks you start using Ajax to do quick calls and updates. My question is there a general rule of thumb when to use Ajax and when to use a link? I only ask because I seem to be using Ajax more then not and I'm worried that any errors in the initial page might propagate to other elements. Or with content getting constantly replaced something might go wrong.

我想我问的是有一个网页的任何挫折到重阿贾克斯的用法?

I suppose what I'm asking is there any downfalls to heavy Ajax usage in a web pages?

修改

SEO - 不是一个问题。我只是在想客户端服务器的问题现在。链接打赌阿贾克斯手了,如果你想好的搜索引擎优化

SEO - not an issue. I'm just thinking of client server issues for now. Links would bet Ajax hands down if you wanted good SEO

推荐答案

在我的脑海里,有三个问题与使用AJAX万吨的电话。

In my mind, there are three issues with using tons of AJAX calls.

首先是从用户的角度。如果我做了很多的导航,作为一个用户,我希望能够用我的前进/后退按钮在我的浏览器,并让它们正常工作。如果他们这样做,那么就不是一个问题。如果他们不这样做,你在我的浏览器打破基本的导航。

The first is from a user perspective. If I am doing a lot of navigation, as a user, I want to be able to use my back/forward buttons in my browser and have them work correctly. If they do, then there isn't an issue. If they don't, you've broken fundamental navigation in my browser.

二是书签/索引。作为一个用户,我可能想收藏的东西,所以我可以回来,或分享。作为一个索引的搜索引擎,你作为一个开发者想要让搜索引擎看你有信息的所有网页,使人们可以找到你的网站。这两种需要某种独特的URL。

Second is bookmarking/indexing. As a user, I may want to bookmark something so I can come back to it or share it. As an indexer for a search engine, you as a developer want to let the search engine "see" all the pages of information you have so that people can find your site. Both of these require some sort of unique url.

三是从发展的眼光来看调试。更随机的东西,你扔在一个页面和/或动态更换,就越难获得追查出了什么问题。你越是需要被很好整合或可能产生不良反应也就越多。

Third is debugging from a development point of view. The more random stuff you are throwing on a page and/or replacing dynamically, the harder it gets to track down what's wrong. The more you have the more that needs to be integrated well or could interact badly.

阅读全文

相关推荐

最新文章