Dependent file loading method
The invention provides a dependent file loading method. The method comprises the following steps that 1, a js file is introduced into a page at first, and a js file for configuration is defined by a user and also introduced into the page; 2, a path of a needed js file, a corresponding key_name and d...
Gespeichert in:
Hauptverfasser: | , , , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention provides a dependent file loading method. The method comprises the following steps that 1, a js file is introduced into a page at first, and a js file for configuration is defined by a user and also introduced into the page; 2, a path of a needed js file, a corresponding key_name and dependent files thereof are defined in a config file; 3, js files needing to be introduced into a partial view are determined. The needed js files can be loaded as needed, the page file request number is decreased, the js files can be loaded synchronously, and the partial view is shown after loading is completed.
本发明提供了种依赖文件的载入方法,其包括以下步骤:步骤,页面中首先要引入本js文件,并自己定义个配置用的js文件,也引入到页面里面来;步骤二,在config文件中定义好所需js文件的路径、对应的key_name以及各自的依赖文件;步骤三,确定个局部视图中需要引入哪些js文件。本发明可以按需加载所需的js文件,减少页面的文件请求数,还可以同步加载js文件,直到加载完成之后才呈现该局部视图。 |
---|