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

The little secrets of JavaScript and its framework jQuery

高洛峰
Release: 2016-11-25 14:07:54
Original
998 people have browsed it

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.


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template