This article is a temporary plug-in for introducing my jQuery implementation solution in our company. I. Summary
This series of articles will take you into the wonderful world of jQuery. Many of them have their specific experiences and solutions. Even if you use jQuery, you can find some tips.
This article is a temporary plug-in for introducing my jQuery implementation solution in our company.
Ii. Preface
With the solid basic knowledge of the previous chapters, we can already invest in jQuery In the project. Continue to learn more about jQuery and plug in my jQuery implementation solution.
Different companies have different situations. for example, the webpage files of our company are all user controls, and there is no absolute relationship between the physical path and the virtual path, so we cannot use the relative path (otherwise, the file will not be found in the production environment ). there are many projects. Different folders in the same virtual directory correspond to different project projects.
This solution is not generic, but some methods can be used for reference. I also hope to discuss it with you to help me correct it.
Iii. Library File Management Solution
Root path:Src \ Assembly \ resource. eLong. Web. Files \ Resource \ JSLib \ jquery \
Reference root path:Http://resource.elong.com/JSLib/jquery/
Compressed version Reference Path:Http://resource.elong.com/JSLib/jquery/jquery-min-lastest.js
Root path file list:
Create a js folder under each Web project and place the jquery-vsdoc-lastest.js file:
Note:
First, put all versions of the jQuery class library on the static server, and store the class library files according to the folder. However, the latest version will be selected for reference and placed in the root directory.
The root directory contains the following files:
Name |
Content |
Description |
Folder 1.3.2 |
The jQuery class library is organized by version number. |
For each jquery version later than 1.3.2, class library files will be stored according to the folder, but the latest stable version will be used to overwrite the js files named by each lastest. |
Folder plugin |
Folder for storing plug-ins |
Store various plug-ins in this path as folders |
Jquery. extend-lastest.js |
JQuery method extended by elong |
In the future, we will build our own javascript class library. Some of the core class libraries will be put in this file, which is equivalent to our own tool class library. It will be implemented through jQuery extension. Mainly divided into tool functions and function packaging. |
Jquery-lastest.js |
Latest Version of jQuery uncompressed class library |
The latest stable version of the original jQuery class library. |
Jquery-min-lastest.js |
Latest Version of jQuery compression class library |
The latest stable version of The jQuery compression class library. |
Jquery-vsdoc-lastest.js |
JQuery smart prompt library Latest Version |
The latest stable version of The jQuery smart prompt class library. |
To implement SMART awareness during development, you also need to place the version in the js folder of each web project. because there are many Web projects, Please create this folder for the first user in the future and put it into a file.
Iv. Class Library Reference Scheme
In all the page headers, The jQuery class library is first referenced and the absolute path is used:
Http://resource.elong.com/JSLib/jquery/jquery-min-lastest.js
Then, use if (fasle) to introduce the script block of the smart prompt version. Use the path "~ "Start searching from the root directory. I create a unified js folder in the project source code of each channel and place the latest intelligent sensing version library of the jquery-vsdoc-lastest.js. note that this file does not need to be packaged and uploaded. It is only used for smart prompts during development.
This ensures that only the compressed jQuery class library is introduced on the compiled page.
Sample Code:
<Head Runat= "Server"> <Title>JQuery reference scheme
Title> <Script Type= "Text/javascript" Src= "Http://resource.elong.com/JSLib/jquery/jquery-min-lastest.js? 1.1.23">
Script><%If(False) {%>