当前位置: 代码迷 >> Web前端 >> (二)入门指南――(11)总结(Summary)
  详细解决方案

(二)入门指南――(11)总结(Summary)

热度:397   发布时间:2013-09-12 22:07:00.0
(2)入门指南――(11)总结(Summary)
We now have an idea of why a developer would choose to use a JavaScript framework rather than writing all code from scratch, even for the most basic tasks. We also have seen some of the ways in which jQuery excels as a framework, why we might choose it over other options, and in general which tasks jQuery makes easier.

我们现在已经知道了为什么额开噶者选择使用js框架而不是从头开始书写代码,甚至是最简单的代码都这样。我们也看到了,作为一个框架jquery擅长的地方,为什么我们选择它而不是其他选择,和一般而言jquery会使哪些任务更加简单。

In this chapter, we have learned how to make jQuery available to JavaScript code on our web page, use the $()function to locate a part of the page that has a given class, call .addClass()to apply additional styling to this part of the page, and invoke $(document).ready()to cause this code to execute upon the loading of the page. We have also explored the development tools we will be relying on when writing, testing, and debugging our jQuery code.

在这一章中,我们已经学写了如何让jquery在我们网页中的js中执行,使用$()方法定位网页中一个已经由跟定类的部分,调用.addClass()方法为页面中这一部分添加其他的风格,调用$(document).ready()使这在代码在网页一加载结束的时候去执行。我们已经研究过了我们在书写,测试和调试我们的jquery代码时需要依靠的开发工具。

The simple example we have been using demonstrates how jQuery works, but is not very useful in real-world situations. In the next chapter, we will expand on the code here by exploring jQuery's sophisticated selector language, finding practical uses for this technique.

我们使用的这个简单的例子展示了jquery是如何工作的,但是在真实的场景中并不是很有用的。在下一章节,我们将通过探索jquery的复杂的选择语言扩展此处的代码,发现这一技术的实用价值。