Home  >  Article  >  Web Front-end  >  The little secrets of JavaScript and its framework jQuery

The little secrets of JavaScript and its framework jQuery

高洛峰
高洛峰Original
2016-11-25 14:07:54986browse

Recently when I was doing front-end work in jQuery, I found that when applying ajax and passing its parameters, for example: url: "LoadAction?mark=load", in the LoadAction class, the mark received is an object. If you make a judgment, , then mark.equals("load") will successfully enter and determine success. If mark=="load" is applied, the judgment fails. In traditional JavaScript applications, on the contrary, the mark passed in is a variable.

                                                                                                                          Explain the difference between equals and ==. The former is generally used for comparison with objects, and the latter is used for comparison between constants and variables. The object value is the same but the address is different. It's just like a person's name. Maybe there are many people with the same name as you in China, but not one person. It can only be said that the names are the same. But the variable corresponds to an address. That is to say, although your name has changed, you are a person and your nature will not change. My understanding is rudimentary and I hope that any mistakes can be corrected. So as not to mislead others.


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn