Home Web Front-end JS Tutorial (jQuery, mootools, dojo) Use a programming alias that suits you_jquery

(jQuery, mootools, dojo) Use a programming alias that suits you_jquery

May 16, 2016 pm 06:19 PM
name

For example, you can often see the following code in jQuery

Copy the code The code is as follows:

( function($){
//some code
})(jQuery)

This way you can use $ instead of jQuery;

In mootools you can Written like this, because in mootools $$ represents a set

Copy the code The code is as follows:

(function($){
//do sth.
})(document.id)

In Dojo you can write like this
Copy code The code is as follows:

(function(d,$){
})(dojo,dojo. query)

In this case, you can use $ instead of dojo.query in dojo; to achieve fast conversion from jQuery to dojo;
To imitate mootools, you can write like this
Copy code The code is as follows:

(function(d,$,$$){
/ /do sth;
})(dojo.dojo.ById,dojo.query)

This way you can use $ instead of dojo.ById and $$ instead of dojo.query;
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Considerations for parameter order in C++ function naming Considerations for parameter order in C++ function naming Apr 24, 2024 pm 04:21 PM

In C++ function naming, it is crucial to consider parameter order to improve readability, reduce errors, and facilitate refactoring. Common parameter order conventions include: action-object, object-action, semantic meaning, and standard library compliance. The optimal order depends on the purpose of the function, parameter types, potential confusion, and language conventions.

Step-by-step guide for creating folders on Realme mobile phone Step-by-step guide for creating folders on Realme mobile phone Mar 23, 2024 pm 03:51 PM

Step-by-Step Guide to Creating Folders on Realme Mobile Phones In our daily lives, we use our phones to store a variety of files, including photos, videos, documents, and more. However, as time goes by, the number of files on your phone may increase, causing insufficient memory on your phone or making it difficult to manage files. In order to better organize files and improve the efficiency of mobile phone use, the establishment of mobile phone folders has become particularly important. Realme Mobile is a popular smartphone brand with a powerful system and diverse features. Creating folders on Realme phones can help users better organize files

What mistakes should be avoided in golang function naming? What mistakes should be avoided in golang function naming? Apr 22, 2024 pm 09:18 PM

Go function naming errors and countermeasures: avoid empty names and use descriptive names. Avoid lengthy names and use abbreviations or concise terms. Use lowercase letters to name functions for consistency. Avoid using underscores to keep your code clear. Make sure the name is consistent with the function and accurately reflects the function's functionality.

All-caps nomenclature for C++ function naming All-caps nomenclature for C++ function naming Apr 24, 2024 pm 03:06 PM

C++ all-caps nomenclature is a convention for naming functions in which all uppercase letters are used for function names. It is usually used for macro definitions and inline functions to avoid name confusion. grammar:(){...}. For example: inlineintADD_NUMBERS(inta,intb){}, this function calculates the sum of two numbers.

Why is the Go language called Go? Why is the Go language called Go? Mar 08, 2024 am 10:21 AM

Title: Why is the Go language called Go? The Go language (also known as Golang) is a programming language developed by Google. Since its first release in 2009, its popularity has continued to grow and it is widely used in a variety of fields, including network programming, cloud computing, big data processing wait. However, many people are curious about why the word "Go" was chosen as the name of the Go language. In this article, we will explore the reason why the Go language is named "Go". First of all, the Go language was named after 200

Why is the Go language named Go? Why is the Go language named Go? Mar 07, 2024 am 10:45 AM

Go language, also known as Golang, is a programming language developed by Google. Its design goals are efficiency, readability, and simplicity. Go language has been widely used in cloud computing, big data processing, network programming and other fields. However, for many people, a question about the Go language is: why did you choose to name this language "Go"? The origins of the Go language can be traced back to 2007, when three Google engineers Robert Griesemer, Rob Pike and Ken

Choosing between abbreviations and full names in C++ function naming Choosing between abbreviations and full names in C++ function naming May 04, 2024 am 09:33 AM

When naming C++ functions, it is recommended to use the full name for clarity, readability, and searchability. The abbreviation for ただし and では is used in the following situations: できます. Abbreviations are well-known for long function names. Code libraries use a uniform abbreviation convention.

C++ function best practices: How to define meaningful function names? C++ function best practices: How to define meaningful function names? May 02, 2024 am 09:36 AM

In order to ensure the readability and maintainability of C++ code, it is important to define meaningful function names. Specific guidelines include: Use verbs and nouns to describe function purpose, such as "GetAverage" or "UpdateUserInfo". Keep names short but descriptive and avoid long or ambiguous names. Use camelCase nomenclature, using capital letters to indicate word boundaries. Avoid abbreviations or technical terms, keep naming consistent, and isolate function names to prevent conflicts.

See all articles