DOM: Document ProcessingInternal insert: Parent-child relationship$ ("a"). Append ($ ("B")) Insert B into the back of "a" in a$ ("B"). AppendTo ($ ("a")) Insert B into the back of "a" in a$ ("a"). Prepend ($ ("B")) Insert B into the "A in front" of "
Picture lazy loading (picture appears in the viewable area and then loaded)Compatibility: Compatible with all currently popular browsers, including: Compatible to IE6) how to use:
Introduce the corresponding JS file
Initialization
jquery Operation Dom:To modify a property:Using the attr () methodattr (name, value)Name: Property name of the property to be modifiedValue: the corresponding valueAttr method, if the current tag has a property to be modified, it will be modified,
Gets the object//js gets the DOM object, jquery gets the jquery object//jquery object can output DOM object, index way output DOM object, EQ () [] mode output DOM object; Gets the element/*var Div=document.getelementbyid ("one") by ID; alert
After the document has not been loaded and the jquery selector is used to select the element, if the immediate binding event is invoked, it will cause JS error (can not read the property of undefined), causing the event to fail to bind
First, function creation1. function declaration (appears in global scope, or local scope)function Add (A, b) { return a + b;}function Add (A, b) { return add1 (a); function add1 (M, N) { return m + n; }}2. Function
IntroducedUseAPI descriptionAjaxformAjaxsubmitFieldserializeResetformClearFormClearfieldsParameter examplesIn general, it is possible to submit a form after the data is $("form").serialize() serialized, $.ajax $.post but the jquery-only approach
urls.py: from Import URL from Import = [ url (r'^$', Aptest.index, name='index ' ),]Edit views.py, define home page: fromDjango.views.decorators.csrfImportcsrf_exempt #导入csrf_exempt模块 @csrf_exempt#because of the CSRF mechanism, you need to call
2048 Games Written in Javascript, javascript2048
Last year, 2048 was very popular, and I had never played it. My colleagues said that if I use JS to write 2048, I only needed more than 100 lines of code;
I tried it today, and the logic is not
I. Events
1. Load DOM
$ (Document). ready () is described in detail in section 1.
2. Event binding
JQuery defines the bind () method as a unified interface to bind an event handler for each matching element. Basic Syntax: bind (type, [data], fn
The thought of Cauchy function: a pre-processing idea of JS; using function execution can form a non-destroying scope, storing the content that needs to be pre-processed in this non-destroyed scope, and returning a small function that we are going
Analysis of DOM Event bubbling instances in JQuery
What is bubble?
There can be multiple events on the page, or multiple elements can respond to the same event. Assume that there are two elements on the webpage, one of which is nested in the other,
One, jquery event applicationReady (): Similar to onload (), but it is only triggered when the page DOM structure is loaded, and onload () must have all the elements of the page loaded successfully.// $ (document). Ready (function () {}); equivalent
Introduction: angular-smarty, angular JS tool that can automatically complete the UI
This article mainly introduces angular-smarty, an AngularJS tool that can automatically complete the UI, including the use of the isolation scope binding directive
Add or delete events using attachEvent and detachEvent in IE browser. In other standard browsers, addEventListener and removeEventListener are used. The following encapsulates the addition and deletion of events. Check the Code directly!
/*** @
In-depth explanation: the socket communication principle and socket communication principle of php
Are you familiar with TCP/IP, UDP, and Socket programming? With the development of network technology, these words are filled with our ears. So I want
Cross-browser addition and deletion of event binding function instances and JavaScript instances using javascript
This example describes how to add and delete event binding functions across browsers using JavaScript. Share it with you for your
Triple Realm of PHP decoupling (talking about service containers) and Triple Realm
Before reading this article, you need to understand: PHP syntax, object-oriented
In the process of completing the entire software project development, sometimes many
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.