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"