$.extend () Method and (function ($) {...}) (jQuery) details about JS in-depth usage. "Use Strict"

Source: Internet
Author: User

This time the release content finally finished, can study the use of things.

Before writing JS is the basic writing, write a function,

This time to see colleagues with jquery and JS write plug-ins with the new knowledge that they do not know, I think it is necessary to learn a bit.

1. "Use strict"; JS can be written in the file to put this sentence, do not know what the meaning, check, it should be more rigorous JS wording, when there is not meet the requirements of JS, the system will error

Look at an example of an explanation foo = ' AA '; When you add this sentence, you will get an error. It's about grammar more rigorous. Can write to function inside can also write to the entire JS file

2. $.fn.extend is a positive pair of jquery objects

e.g: $.fn.colorbox.removborder = function () {...}; This means adding a new method Removeborder () to the jquery Colorbox instance.

3. $.extend ()

4. Add +,-new () and so on in front of function

5. (function ($) {...}) (jQuery) What does this mean?

These properties are written plug-ins can be used, it has not used before, JS Pototype js closure These JS high-level programming is not involved in the use of all the JS fur

To learn something too much, come on.

Reference:

http://blog.csdn.net/xuemoyao/article/details/19021659

Http://www.cnblogs.com/RascallySnake/archive/2010/05/07/1729563.html

Http://www.cnblogs.com/wyjgreat/archive/2011/07/19/2110754.html

http://swordair.com/function-and-exclamation-mark/Analysis +,-in the function front Plus +,-and so on.

Http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/about use Strict.

$.extend () Method and (function ($) {...}) (jQuery) details about JS in-depth usage. "Use Strict"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.