Parameter-passing javascript module file induction execution method
A module file and file technology, applied in the field of front-end development, can solve problems such as code coupling and maintenance difficulties, and achieve the effect of strong independence
Active Publication Date: 2015-09-16
G CLOUD TECH
View PDF6 Cites 3 Cited by
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
[0005] The technical problem solved by the present invention is to provide a method for importing and executing javascript module files that can pass parameters, and solve the code coupling and maintenance difficulties brought about by the traditional mode of "importing javascript module files-calling javascript module interfaces in other places" The problem
Method used
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View moreImage
Smart Image Click on the blue labels to locate them in the text.
Smart ImageViewing Examples
Examples
Experimental program
Comparison scheme
Effect test
specific Embodiment approach
[0038]第一步,在easySlider中添加以下代码:
[0039]获取参数:
[0040]
[0041]
[0042]
[0043]第二步,通过的方式引入。与传统引入方式的显著差异是:添加了data-sliderID和data-config这两个参数。easySlider模块文件内部在解析的过程中调用了第一步添加的代码,即可在ID为myslider的元素中,使用了speed:600,auto:true,continuous:true这三个参数执行了easyslider效果。其中speed:600是使用了外部传入的方式,其余两个均直接使用了模块内部自定义的默认值,如需要覆盖这两个值,在data-config增加即可。
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More PUM
Login to View More Abstract
The invention relates to the technical field of front-end development, in particular to a method suitable for introducing a javascript module file needing passed parameters to be flexible and reusable. The method includes the steps that correlation logical codes for obtaining the passed parameters, processing the parameters, calling interfaces and the like are additionally arranged in the introduced javascropt module file; by conventionally introducing the javascript module file, self-defined parameters are additionally arranged into a <script> label according to module requirements; the introduced javascript module file executes the additionally-arranged processing codes in the loading and analysis process, and therefore independent execution mechanism introduction is achieved. By means of the method, the quite-flexible javascript module file can be built, an execution mechanism can be introduced in the mode that the parameters are passed at the <script> label, and the module interfaces can be called through a traditional mode if the parameters are not passed. The method is used for javascript module introduction execution.
Description
technical field [0001] The invention relates to the technical field of front-end development, and is especially suitable for introducing flexible and reusable javascript module files that require incoming parameters. Background technique [0002] With the continuous development of front-end technology in recent years, users have higher and higher requirements for the human-computer interaction of the software interface, which makes the software interface more and more complex. Front-end developers are more and more inclined to develop a The reusable javascript module module is encapsulated in a single js file. When using this module file, use the appropriate parameters to call the interface to quickly achieve some common interactive effects. The reusable modular development mode can greatly improve the development staff productivity. [0003] At the same time, the jquery framework and software open source are popular, and the simple, elegant and smooth calling method of jqu...
Claims
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More Application Information
Patent Timeline
Login to View More Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
Inventor 陈健豪艾建文孙傲冰季统凯
Owner G CLOUD TECH
