在学习jQuery之前学习JavaScript是个好主意吗?

时间:2022-05-04 11:49:06

Is it a good idea to learn JavaScript before learning a JavaScript framework library such as jQuery, Prototype, etc.?

在学习JavaScript框架库(如jQuery、Prototype等)之前学习JavaScript是一个好主意吗?

Sometimes I find myself struggling because I feel I don't know JavaScript as well as I should.

有时我发现自己在苦苦挣扎,因为我觉得自己不太懂JavaScript。

19 个解决方案

#1


80  

An emphatic YES. It won't take as long to learn as you fear and the rewards will be more than worth it.

肯定的。学习的时间不会像你担心的那样长,回报也会很值得。

#2


39  

Sometimes I find myself struggling because I feel I don't know Javascript as well as I should?

有时我发现自己在苦苦挣扎,因为我觉得自己不太懂Javascript ?

I think you answered your own question.

我想你已经回答了你自己的问题。

#3


21  

I'll go against the grain and say that, while ideally you would become proficient in JavaScript before learning jQuery, you can probably make great progress on both fronts by jumping in and coding using the library.

我将反对这一观点,并说,理想情况下,在学习jQuery之前,您将精通JavaScript,您可以在这两方面取得很大的进展,通过使用库进行跳转和编码。

One of jQuery's strengths is that it makes it easier to do certain things in the browser. You can get a lot of real work done by cutting and pasting and adapting other people's code, so why not start doing that? As you go, when you encounter an idiom you don't quite understand, dig around and find out what it means or how it works.

jQuery的优点之一是它使得在浏览器中做某些事情变得更加容易。通过剪切、粘贴和修改其他人的代码,您可以完成很多真正的工作,所以为什么不开始这样做呢?当你遇到一个你不太理解的习语时,你可以去了解它的意思或者它是如何运作的。

Over time, you will become a master of both JavaScript and jQuery.

随着时间的推移,您将成为JavaScript和jQuery的大师。

If you have any kind of programming background, a good book to read to get you up to speed quickly on JavaScript is Douglas Crockford's, JavaScript: The Good Parts.

如果你有任何编程背景,你可以读读Douglas Crockford的《JavaScript:好的部分》(JavaScript: The good Parts),这本书能让你快速掌握JavaScript。

#4


18  

Long as you learn the BASICS in Javascript; HTML document traversing, event handling, etc... you should have no problem learning jquery.

只要您学习Javascript的基础知识;HTML文档遍历、事件处理等…学习jquery应该没有问题。

Then from learning the basics you will understand how Jquery is to help you do the things that javascript can do, but with less work.

然后,通过学习基本知识,您将了解Jquery如何帮助您完成javascript可以完成的工作,但工作量要少一些。

#5


10  

The answer to your question is a definitive yes. jQuery, Prototype and the rest serve to overcome cross-browser headaches and ease AJAX, UI behaviours, DOM operations etc. You'll end up with some pretty bad code if you are just copy/pasting snippets or have no real understanding of Javascript.

你的问题的答案是肯定的。jQuery、Prototype和其他工具可以克服跨浏览器的问题,并简化AJAX、UI行为和DOM操作等。

As a litmus test, you should be able to follow everything that is said in this wonderful re-introduction to Javascript. It's a bare minimum for writing good code and may require some more Googling on your part. Only then should you read Willison's equally good introduction to jQuery.

作为一个试金石,您应该能够遵循在这个精彩的Javascript重新介绍中所说的一切。这是编写好代码的最低要求,可能需要更多的google搜索。只有这样,你才能读到威利森同样出色的jQuery入门。

That should provide you a good start to build upon. And then if you feel up to it, you can start digesting Crockford (start with Douglas Crockford — JavaScript: The Good Parts).

这应该会给你一个良好的开端。然后如果你觉得可以,你可以开始消化Crockford(从Douglas Crockford - JavaScript: The Good Parts)。

#6


4  

Yes it a good idea because jQuery provides you with shortcuts for some methods and effects. By learning JavaScript you get the complete idea about how jQuery is working. It will help you to solve bugs and issues in future, when you will be working on a project.

是的,这是个好主意,因为jQuery为您提供了一些方法和效果的快捷方式。通过学习JavaScript,您可以完全了解jQuery是如何工作的。它将帮助您解决错误和未来的问题,当您将从事一个项目。

#7


3  

Call me old-fashioned, but I think it is best to learn the basics of one tool before moving on to its advanced cousin -- much like being competent with a handsaw before moving on to a circular saw.

你可以说我是老式的,但我认为最好在学习一种工具的基础知识后再学习它的高级表亲——就像在学习圆锯之前熟练使用手锯一样。

If you are struggling, you've answered your own question. I feel you'll be better equipped to make good use of JQuery once you are comfortable with JavaScript.

如果你在挣扎,你已经回答了自己的问题。我觉得一旦你熟悉了JavaScript,你就能更好地利用JQuery了。

#8


2  

When I started my switch from VBScript to JavaScript I was immediately enthralled with Jquery. After a short while I started to really understand how JavaScript and Jquery interacted with each other and I became a little confused and frustrated. My issue was with the desire to use the simplicity of Jquery but I felt like I was cheating myself by not learning JavaScript first.

当我开始从VBScript切换到JavaScript时,我立刻被Jquery迷住了。过了一会儿,我开始真正理解JavaScript和Jquery是如何相互作用的,我变得有点困惑和沮丧。我的问题是想要使用Jquery的简单性,但我觉得我没有首先学习JavaScript是在欺骗自己。

It turned out that I learned both at the same time. As I wrote JQuery routines I found the need to learn JavaScript in order to understand why things worked the way they did and to help make certain Jquery routines work correctly.

结果我同时学会了这两种语言。当我编写JQuery例程时,我发现有必要学习JavaScript,以便理解为什么事情会以它们的方式进行,并帮助使某些JQuery例程正确工作。

I am still learning JavaScript and Jquery but I am much less concerned about becoming a master of JavaScript as I know my understanding will grow as it needs to. It definitely helps to have some basic understanding of JavaScript but I would say you should focus on learning how to accomplish specific tasks and not on learning JavaScript before JQuery...

我仍在学习JavaScript和Jquery,但我不太担心成为JavaScript的大师,因为我知道我的理解会随着需要而增长。对JavaScript有一些基本的理解是很有帮助的,但是我认为你应该专注于学习如何完成特定的任务,而不是在JQuery之前学习JavaScript。

My $0.02 worth.

我的0.02美元的价值。

#9


2  

As I see it, jQuery is nothing but a framework to make your life simpler. jQuery itself is written in javascript. So it helps to learn javascript.

在我看来,jQuery不过是一个使您的生活更简单的框架而已。jQuery本身是用javascript编写的。所以学习javascript是有帮助的。

Mind you, you need not be a master but should be able to make the necessary changes /work arounds, when what you can do with jQuery alone is not sufficient.

请注意,您不需要精通,但应该能够进行必要的更改/工作,而仅使用jQuery是不够的。

#10


2  

To some degree, but don't get hung up on object oriented programming like in the java world (in javascript it's prototyping anyway). It would help in the long run to have a good understanding of closures/anonymous function and how the special variable "this" is used (particularly with regards to events such as click) and how functions like "apply" work. I'd also make sure that you really understood CSS selectors as they are a central feature of jQuery and pretty much every other JS framework out there.

在某种程度上,但不要像在java世界中那样沉迷于面向对象的编程(在javascript中,它是原型)。从长期来看,对闭包/匿名函数有很好的理解,以及如何使用特殊变量“this”(特别是关于click之类的事件),以及如何使用“应用”工作。我还要确保您真正理解CSS选择器,因为它们是jQuery的一个中心特性,而且几乎是其他所有JS框架。

You're also going to need to be familiar with how to use the full functionality of firebug.

您还需要熟悉如何使用firebug的全部功能。

I'd also assume you have a basic understanding or knowledge of how the DOM works.

我还假设您对DOM如何工作有基本的理解或了解。

That's the start of tinkering in Javascript.

这是修补Javascript的开始。

#11


2  

The value proposition for jQuery (or any other framework) doesn't only come from what it does with javascript. It also builds on the DOM, HTML, and a number of language-agnostic patterns. And you don't need to understand it all in depth to find frameworks useful. Of course, you'll be better off if you know all the pieces, but we all need to start from something less.

jQuery(或任何其他框架)的价值主张不仅来自于它对javascript的处理。它还构建在DOM、HTML和一些与语言无关的模式之上。你不需要深入地理解它,就能找到有用的框架。当然,如果你知道所有的部分,你会更好,但是我们都需要从更少的东西开始。

I learned jQuery and javascript simultaneously, and it worked quite well for me that way.

我同时学习了jQuery和javascript,这对我来说非常有用。

I think the question isn't so much which to learn first, but more to the point, you need to expect to become increasingly familiar with all the pieces and how they work together.

我认为问题不在于首先要学习什么,而在于你需要越来越熟悉所有的部分以及它们是如何一起工作的。

To me it's somewhat (not entirely) the same question as what you need to know before starting with WebForms. Sure it's better if you're already comfortable with C# (and the same DOM and html), but it's legitimate to use WebForms as a vehicle for your education. Same thing can be said for frameworks.

对我来说,这有点(不完全)和你在使用WebForms之前需要知道的问题相同。当然,如果您已经熟悉c#(以及相同的DOM和html)会更好,但是使用WebForms作为您的教育工具是合法的。框架也是如此。

#12


2  

Suppose you should know the following about Javascript:

假设您应该了解以下关于Javascript的内容:

  1. How to calculate the X and Y element offset for the absolute/relative positioned DIV for browsers IE6-IE8, FireFox, Opera, Safari (each of the browser has different model for this particular case).

    如何计算浏览器IE6-IE8、FireFox、Opera、Safari的绝对/相对位置DIV的X和Y元素偏移量(每种浏览器都有不同的模型)。

  2. What is closure and how to create it.

    什么是闭包以及如何创建它。

  3. How to create onLoad event in the browsers listed above.

    如何在上面列出的浏览器中创建onLoad事件。

  4. Have an example of the HTML/Javascript code where you have pure HTML code like

    有一个HTML/Javascript代码示例,其中有纯HTML代码,比如

<a href="" rel="remove">Remove</a>

< a href = " " rel = "删除" > < / >删除

and javascript code that add special handlers in automatic mode for A tag using "rel" attribute.

javascript代码,在自动模式中添加特殊的处理程序,使用“rel”属性。

After you get acquainted with this you may use jQuery library that hide the complexity of this :)

在您熟悉这个之后,您可以使用jQuery库来隐藏它的复杂性:)

Regards, Pavel

问候,帕维尔

#13


2  

I think learning events the document object model, and JavaScript forms programming is enough to get started in jQuery.

我认为学习事件文档对象模型和JavaScript表单编程就足以开始jQuery了。

#14


1  

Of course, it goes without saying. How can you use jQuery if you don't learn JavaScript first? After all, jQuery is nothing but a library for JavaScript.

当然,这是不言而喻的。如果不先学习JavaScript,如何使用jQuery ?毕竟,jQuery不过是一个JavaScript库。

#15


1  

Yes.

是的。

You obviously don't need to learn everything about JS. But at least learn the basics, and try to learn some best practices.

显然,您不需要了解关于JS的所有内容。但至少要学习基本知识,并尝试学习一些最佳实践。

For me the trickiest part about Javascript is all the different implementations of it in the different browsers. But there are certain things you can do to help yourself avoid some of those problems. For example, it's usually preferred to use document.getElementById() to access elements in the DOM since it essentially works the same way in all modern browsers. Also, it's almost always best to use feature detection rather than browser detection. Little things like that go a long way in avoiding problems in specific browsers later on.

对于我来说,Javascript最棘手的部分就是它在不同浏览器中的不同实现。但是你可以做一些事情来帮助自己避免这些问题。例如,通常更喜欢使用document.getElementById()来访问DOM中的元素,因为它在所有现代浏览器中的工作方式都是相同的。此外,几乎总是最好使用特性检测而不是浏览器检测。类似这样的小事情对于以后避免特定浏览器中的问题大有帮助。

Fortunately JQuery was written pretty well for cross-browser compatibility, but there may be times when you don't want to use it directly and you may have to rely on your JS skills.

幸运的是,JQuery编写得非常适合跨浏览器兼容性,但有时您可能不想直接使用它,您可能不得不依赖于您的JS技能。

#16


1  

There are really two seperate aspects to JavaScript within the Browser. First, the JavaScript Language, and second the HTML DOM that allows you to manipulate the page using the JavaScript Language.

在浏览器中,JavaScript有两个独立的方面。首先是JavaScript语言,其次是允许您使用JavaScript语言操作页面的HTML DOM。

That said, then YES you should spend time learning the JavaScript Language. I recommend picking up a copy of "JavaScript: The Good Parts" by Douglas Crockford.

也就是说,你应该花时间学习JavaScript语言。我推荐您阅读Douglas Crockford的《JavaScript:美好的部分》。

Now as to the second part, the HTML DOM. You really don't need to focus too much on learning the ins and outs of the HTML DOM if you are going to use a framework like jQuery. Just do things the "jQuery way" and then pick up as much HTML DOM as is necessary along the way.

至于第二部分,HTML DOM。如果要使用jQuery这样的框架,您真的不需要过多地关注HTML DOM的内外信息。只需以“jQuery方式”进行操作,然后在此过程中获取所需的尽可能多的HTML DOM。

#17


0  

Just enough to debug your code. Otherwise, you will never be able to figure out what's not working.

只需调试代码即可。否则,你将永远无法弄清楚什么是无效的。

#18


0  

Learning JS would make life easier for coding JQuery but I don't see why you should necessarily learn it first. You'll just have to learn it eventually.

学习JS会让编写JQuery变得更容易,但我不明白为什么一定要先学习它。你最终必须学会它。

#19


0  

My first thought was that It's always good to learn something new and Javascript is becoming ubiquitous (now is on the server side too ).

我的第一个想法是,学习新东西总是很好,Javascript也变得无处不在(现在也在服务器端)。

It's seems that you have still not decided the best answer for you and AFAIK this question was posted before March 21 ... I see plenty of time to read at least this that was written by a very talented guy.

看来你还没有决定最好的答案,这个问题是在3月21日之前发布的……我有足够的时间阅读这篇由一个很有才华的人写的文章。

If you study javascript you will never come to SO asking question like:

如果你学过javascript,你永远也不会遇到这样的问题:

What the keyword this mean in the contest of my snippet of code?

这在我的代码片段的竞争中意味着什么?

But if you always are in a hurry, without having time to improve your code and If you never have to build jQuery plugins go without Javascript.

但是如果你总是匆匆忙忙,没有时间去改进你的代码,如果你从来都不需要构建jQuery插件,那么就不要使用Javascript。

#1


80  

An emphatic YES. It won't take as long to learn as you fear and the rewards will be more than worth it.

肯定的。学习的时间不会像你担心的那样长,回报也会很值得。

#2


39  

Sometimes I find myself struggling because I feel I don't know Javascript as well as I should?

有时我发现自己在苦苦挣扎,因为我觉得自己不太懂Javascript ?

I think you answered your own question.

我想你已经回答了你自己的问题。

#3


21  

I'll go against the grain and say that, while ideally you would become proficient in JavaScript before learning jQuery, you can probably make great progress on both fronts by jumping in and coding using the library.

我将反对这一观点,并说,理想情况下,在学习jQuery之前,您将精通JavaScript,您可以在这两方面取得很大的进展,通过使用库进行跳转和编码。

One of jQuery's strengths is that it makes it easier to do certain things in the browser. You can get a lot of real work done by cutting and pasting and adapting other people's code, so why not start doing that? As you go, when you encounter an idiom you don't quite understand, dig around and find out what it means or how it works.

jQuery的优点之一是它使得在浏览器中做某些事情变得更加容易。通过剪切、粘贴和修改其他人的代码,您可以完成很多真正的工作,所以为什么不开始这样做呢?当你遇到一个你不太理解的习语时,你可以去了解它的意思或者它是如何运作的。

Over time, you will become a master of both JavaScript and jQuery.

随着时间的推移,您将成为JavaScript和jQuery的大师。

If you have any kind of programming background, a good book to read to get you up to speed quickly on JavaScript is Douglas Crockford's, JavaScript: The Good Parts.

如果你有任何编程背景,你可以读读Douglas Crockford的《JavaScript:好的部分》(JavaScript: The good Parts),这本书能让你快速掌握JavaScript。

#4


18  

Long as you learn the BASICS in Javascript; HTML document traversing, event handling, etc... you should have no problem learning jquery.

只要您学习Javascript的基础知识;HTML文档遍历、事件处理等…学习jquery应该没有问题。

Then from learning the basics you will understand how Jquery is to help you do the things that javascript can do, but with less work.

然后,通过学习基本知识,您将了解Jquery如何帮助您完成javascript可以完成的工作,但工作量要少一些。

#5


10  

The answer to your question is a definitive yes. jQuery, Prototype and the rest serve to overcome cross-browser headaches and ease AJAX, UI behaviours, DOM operations etc. You'll end up with some pretty bad code if you are just copy/pasting snippets or have no real understanding of Javascript.

你的问题的答案是肯定的。jQuery、Prototype和其他工具可以克服跨浏览器的问题,并简化AJAX、UI行为和DOM操作等。

As a litmus test, you should be able to follow everything that is said in this wonderful re-introduction to Javascript. It's a bare minimum for writing good code and may require some more Googling on your part. Only then should you read Willison's equally good introduction to jQuery.

作为一个试金石,您应该能够遵循在这个精彩的Javascript重新介绍中所说的一切。这是编写好代码的最低要求,可能需要更多的google搜索。只有这样,你才能读到威利森同样出色的jQuery入门。

That should provide you a good start to build upon. And then if you feel up to it, you can start digesting Crockford (start with Douglas Crockford — JavaScript: The Good Parts).

这应该会给你一个良好的开端。然后如果你觉得可以,你可以开始消化Crockford(从Douglas Crockford - JavaScript: The Good Parts)。

#6


4  

Yes it a good idea because jQuery provides you with shortcuts for some methods and effects. By learning JavaScript you get the complete idea about how jQuery is working. It will help you to solve bugs and issues in future, when you will be working on a project.

是的,这是个好主意,因为jQuery为您提供了一些方法和效果的快捷方式。通过学习JavaScript,您可以完全了解jQuery是如何工作的。它将帮助您解决错误和未来的问题,当您将从事一个项目。

#7


3  

Call me old-fashioned, but I think it is best to learn the basics of one tool before moving on to its advanced cousin -- much like being competent with a handsaw before moving on to a circular saw.

你可以说我是老式的,但我认为最好在学习一种工具的基础知识后再学习它的高级表亲——就像在学习圆锯之前熟练使用手锯一样。

If you are struggling, you've answered your own question. I feel you'll be better equipped to make good use of JQuery once you are comfortable with JavaScript.

如果你在挣扎,你已经回答了自己的问题。我觉得一旦你熟悉了JavaScript,你就能更好地利用JQuery了。

#8


2  

When I started my switch from VBScript to JavaScript I was immediately enthralled with Jquery. After a short while I started to really understand how JavaScript and Jquery interacted with each other and I became a little confused and frustrated. My issue was with the desire to use the simplicity of Jquery but I felt like I was cheating myself by not learning JavaScript first.

当我开始从VBScript切换到JavaScript时,我立刻被Jquery迷住了。过了一会儿,我开始真正理解JavaScript和Jquery是如何相互作用的,我变得有点困惑和沮丧。我的问题是想要使用Jquery的简单性,但我觉得我没有首先学习JavaScript是在欺骗自己。

It turned out that I learned both at the same time. As I wrote JQuery routines I found the need to learn JavaScript in order to understand why things worked the way they did and to help make certain Jquery routines work correctly.

结果我同时学会了这两种语言。当我编写JQuery例程时,我发现有必要学习JavaScript,以便理解为什么事情会以它们的方式进行,并帮助使某些JQuery例程正确工作。

I am still learning JavaScript and Jquery but I am much less concerned about becoming a master of JavaScript as I know my understanding will grow as it needs to. It definitely helps to have some basic understanding of JavaScript but I would say you should focus on learning how to accomplish specific tasks and not on learning JavaScript before JQuery...

我仍在学习JavaScript和Jquery,但我不太担心成为JavaScript的大师,因为我知道我的理解会随着需要而增长。对JavaScript有一些基本的理解是很有帮助的,但是我认为你应该专注于学习如何完成特定的任务,而不是在JQuery之前学习JavaScript。

My $0.02 worth.

我的0.02美元的价值。

#9


2  

As I see it, jQuery is nothing but a framework to make your life simpler. jQuery itself is written in javascript. So it helps to learn javascript.

在我看来,jQuery不过是一个使您的生活更简单的框架而已。jQuery本身是用javascript编写的。所以学习javascript是有帮助的。

Mind you, you need not be a master but should be able to make the necessary changes /work arounds, when what you can do with jQuery alone is not sufficient.

请注意,您不需要精通,但应该能够进行必要的更改/工作,而仅使用jQuery是不够的。

#10


2  

To some degree, but don't get hung up on object oriented programming like in the java world (in javascript it's prototyping anyway). It would help in the long run to have a good understanding of closures/anonymous function and how the special variable "this" is used (particularly with regards to events such as click) and how functions like "apply" work. I'd also make sure that you really understood CSS selectors as they are a central feature of jQuery and pretty much every other JS framework out there.

在某种程度上,但不要像在java世界中那样沉迷于面向对象的编程(在javascript中,它是原型)。从长期来看,对闭包/匿名函数有很好的理解,以及如何使用特殊变量“this”(特别是关于click之类的事件),以及如何使用“应用”工作。我还要确保您真正理解CSS选择器,因为它们是jQuery的一个中心特性,而且几乎是其他所有JS框架。

You're also going to need to be familiar with how to use the full functionality of firebug.

您还需要熟悉如何使用firebug的全部功能。

I'd also assume you have a basic understanding or knowledge of how the DOM works.

我还假设您对DOM如何工作有基本的理解或了解。

That's the start of tinkering in Javascript.

这是修补Javascript的开始。

#11


2  

The value proposition for jQuery (or any other framework) doesn't only come from what it does with javascript. It also builds on the DOM, HTML, and a number of language-agnostic patterns. And you don't need to understand it all in depth to find frameworks useful. Of course, you'll be better off if you know all the pieces, but we all need to start from something less.

jQuery(或任何其他框架)的价值主张不仅来自于它对javascript的处理。它还构建在DOM、HTML和一些与语言无关的模式之上。你不需要深入地理解它,就能找到有用的框架。当然,如果你知道所有的部分,你会更好,但是我们都需要从更少的东西开始。

I learned jQuery and javascript simultaneously, and it worked quite well for me that way.

我同时学习了jQuery和javascript,这对我来说非常有用。

I think the question isn't so much which to learn first, but more to the point, you need to expect to become increasingly familiar with all the pieces and how they work together.

我认为问题不在于首先要学习什么,而在于你需要越来越熟悉所有的部分以及它们是如何一起工作的。

To me it's somewhat (not entirely) the same question as what you need to know before starting with WebForms. Sure it's better if you're already comfortable with C# (and the same DOM and html), but it's legitimate to use WebForms as a vehicle for your education. Same thing can be said for frameworks.

对我来说,这有点(不完全)和你在使用WebForms之前需要知道的问题相同。当然,如果您已经熟悉c#(以及相同的DOM和html)会更好,但是使用WebForms作为您的教育工具是合法的。框架也是如此。

#12


2  

Suppose you should know the following about Javascript:

假设您应该了解以下关于Javascript的内容:

  1. How to calculate the X and Y element offset for the absolute/relative positioned DIV for browsers IE6-IE8, FireFox, Opera, Safari (each of the browser has different model for this particular case).

    如何计算浏览器IE6-IE8、FireFox、Opera、Safari的绝对/相对位置DIV的X和Y元素偏移量(每种浏览器都有不同的模型)。

  2. What is closure and how to create it.

    什么是闭包以及如何创建它。

  3. How to create onLoad event in the browsers listed above.

    如何在上面列出的浏览器中创建onLoad事件。

  4. Have an example of the HTML/Javascript code where you have pure HTML code like

    有一个HTML/Javascript代码示例,其中有纯HTML代码,比如

<a href="" rel="remove">Remove</a>

< a href = " " rel = "删除" > < / >删除

and javascript code that add special handlers in automatic mode for A tag using "rel" attribute.

javascript代码,在自动模式中添加特殊的处理程序,使用“rel”属性。

After you get acquainted with this you may use jQuery library that hide the complexity of this :)

在您熟悉这个之后,您可以使用jQuery库来隐藏它的复杂性:)

Regards, Pavel

问候,帕维尔

#13


2  

I think learning events the document object model, and JavaScript forms programming is enough to get started in jQuery.

我认为学习事件文档对象模型和JavaScript表单编程就足以开始jQuery了。

#14


1  

Of course, it goes without saying. How can you use jQuery if you don't learn JavaScript first? After all, jQuery is nothing but a library for JavaScript.

当然,这是不言而喻的。如果不先学习JavaScript,如何使用jQuery ?毕竟,jQuery不过是一个JavaScript库。

#15


1  

Yes.

是的。

You obviously don't need to learn everything about JS. But at least learn the basics, and try to learn some best practices.

显然,您不需要了解关于JS的所有内容。但至少要学习基本知识,并尝试学习一些最佳实践。

For me the trickiest part about Javascript is all the different implementations of it in the different browsers. But there are certain things you can do to help yourself avoid some of those problems. For example, it's usually preferred to use document.getElementById() to access elements in the DOM since it essentially works the same way in all modern browsers. Also, it's almost always best to use feature detection rather than browser detection. Little things like that go a long way in avoiding problems in specific browsers later on.

对于我来说,Javascript最棘手的部分就是它在不同浏览器中的不同实现。但是你可以做一些事情来帮助自己避免这些问题。例如,通常更喜欢使用document.getElementById()来访问DOM中的元素,因为它在所有现代浏览器中的工作方式都是相同的。此外,几乎总是最好使用特性检测而不是浏览器检测。类似这样的小事情对于以后避免特定浏览器中的问题大有帮助。

Fortunately JQuery was written pretty well for cross-browser compatibility, but there may be times when you don't want to use it directly and you may have to rely on your JS skills.

幸运的是,JQuery编写得非常适合跨浏览器兼容性,但有时您可能不想直接使用它,您可能不得不依赖于您的JS技能。

#16


1  

There are really two seperate aspects to JavaScript within the Browser. First, the JavaScript Language, and second the HTML DOM that allows you to manipulate the page using the JavaScript Language.

在浏览器中,JavaScript有两个独立的方面。首先是JavaScript语言,其次是允许您使用JavaScript语言操作页面的HTML DOM。

That said, then YES you should spend time learning the JavaScript Language. I recommend picking up a copy of "JavaScript: The Good Parts" by Douglas Crockford.

也就是说,你应该花时间学习JavaScript语言。我推荐您阅读Douglas Crockford的《JavaScript:美好的部分》。

Now as to the second part, the HTML DOM. You really don't need to focus too much on learning the ins and outs of the HTML DOM if you are going to use a framework like jQuery. Just do things the "jQuery way" and then pick up as much HTML DOM as is necessary along the way.

至于第二部分,HTML DOM。如果要使用jQuery这样的框架,您真的不需要过多地关注HTML DOM的内外信息。只需以“jQuery方式”进行操作,然后在此过程中获取所需的尽可能多的HTML DOM。

#17


0  

Just enough to debug your code. Otherwise, you will never be able to figure out what's not working.

只需调试代码即可。否则,你将永远无法弄清楚什么是无效的。

#18


0  

Learning JS would make life easier for coding JQuery but I don't see why you should necessarily learn it first. You'll just have to learn it eventually.

学习JS会让编写JQuery变得更容易,但我不明白为什么一定要先学习它。你最终必须学会它。

#19


0  

My first thought was that It's always good to learn something new and Javascript is becoming ubiquitous (now is on the server side too ).

我的第一个想法是,学习新东西总是很好,Javascript也变得无处不在(现在也在服务器端)。

It's seems that you have still not decided the best answer for you and AFAIK this question was posted before March 21 ... I see plenty of time to read at least this that was written by a very talented guy.

看来你还没有决定最好的答案,这个问题是在3月21日之前发布的……我有足够的时间阅读这篇由一个很有才华的人写的文章。

If you study javascript you will never come to SO asking question like:

如果你学过javascript,你永远也不会遇到这样的问题:

What the keyword this mean in the contest of my snippet of code?

这在我的代码片段的竞争中意味着什么?

But if you always are in a hurry, without having time to improve your code and If you never have to build jQuery plugins go without Javascript.

但是如果你总是匆匆忙忙,没有时间去改进你的代码,如果你从来都不需要构建jQuery插件,那么就不要使用Javascript。