Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and system for loading code files using annotations

A technology of code files and annotations, which is applied in the field of systems that use annotations to load code files, can solve problems such as the increase in the probability of browser crashes, and achieve the effects of reducing maintenance difficulty, reducing workload, and improving speed

Active Publication Date: 2020-12-15
WUHAN DOUYU NETWORK TECH CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, with the diversification of webpages, the complexity of webpages is getting higher and higher, requiring the use of a large number of javascript files and css files, and the functions of each javascript file or each css file are crossed, such as a javascript file. The realization of the function also needs to rely on a certain function in another javascript file. At this time, the dependent javascript file must be loaded to realize a certain function of the web page. With the intricate relationship between various javascript files or css files, Using this analysis method, the browser's crash probability is also greatly increased

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 more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and system for loading code files using annotations

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0025]以下结合附图对本发明作进一步详细说明。

[0026]参见图1所示,本发明提供一种使用注解方式加载代码文件的方法,用于通过浏览器浏览网页时,浏览器加载网页附带的功能性的代码文件,本实施例中,代码文件包括javascript文件和css文件,javascript文件用于实现网页的动态等功能,css文件用以实现美化网站的样式等功能,当浏览器下载javascript文件和css文件并解析后,便能实现网页的某些特定展示功能。本发明的方法包括:

[0027]步骤S1:下载代码文件至浏览器中并执行,其中,与其它代码文件相关联的代码文件中定义有注解,注解中含有指向相关联代码文件的下载地址,具体的,若某一代码文件功能的实现需要依赖其它代码文件,则该代码文件与其它代码文件相关联,则该代码文件中定义有注解。代码文件下载到浏览器中的方式包括同步下载和异步下载,同步下载为当浏览器在进行文件的下载操作时,此时将浏览器中的其它程序暂停,当文件下载完毕后,其它程序再继续执行;异步下载为当浏览器在进行文件下载操作的同时,浏览器中的其它程序同时也能够继续执行。该步骤中,使用同步下载的方式下载代码文件至浏览器中。

[0028]浏览器在加载网页时,不被其它javascript所依赖的javascript文件均对应有一标记,标记用于告知浏览器需要下载javascript文件,不被其它css文件所依赖的css文件均对应有一标记,标记用以告知浏览器需要下载css文件。

[0029]标记完整的形式为,src=”文件地址”表示该标记所对应的javascript文件所在的地址,当浏览器在解析网页,识别到网页所携带的标记时,便会匹配该标记上的src,从而得到javascript文件的地址,从而将javascript文件下载到浏览器中。

[0030]标记完整的形式为,href=”文件地址”表示该标记所对应的css文件所在的地址,当浏览器在解析网页,识别到网页所携带的标记时,便会匹配该标记上的href,从而得到jcss文件的地址,从而将css文件下载到浏览器中。

[0031]步骤S2:判断代码文件中是否定义有注解。

[0032]注解包括注解所指向的代码文件的下载方式和下载地址,具体的,注解用于对javascript文件或css文件进行管理,注解一般出现在javascript文件或css文件的开头部分,注解的组成包括:一...

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

No PUM Login to View More

Abstract

The invention relates to the field of browser application, and discloses a method for loading code files in a noting manner. The method comprises the following steps: S1, downloading a code file to a browser, and executing the code file, wherein notes are defined in the code file associated with other code files and the notes contain download link pointing the associated code files; S2, judging whether notes are defined in the code files or not; S3, if so, downloading the code files pointed by the notes to the browser, executing the code files, and then returning to the step S2; otherwise, ending. The invention further discloses a system for loading the code files in the noting manner. Through the method and the system, the web page loading speed of the browser can be effectively increased.

Description

technical field [0001] The invention relates to the field of browser applications, in particular to a method for loading code files using annotations and a system for loading code files using annotations. Background technique [0002] The webpage of the browser often needs some code files, such as some javascript files used to realize other functions such as webpage dynamics, and some css files used to beautify the style of the webpage. Usually, when a browser parses javascript files and css files, it relies on the <script>和<link>标记,<script>用来告知浏览器需要加载javascript文件,<link>用来告知浏览器需要加载css文件。[0003]但随着网页多元化的发展,网页的复杂程度也越来越高,需要使用大量的javascript文件和css文件,且各个javascript文件间或各个css文件间的功能相互交叉,如一个javascript文件中某个功能的实现还需依赖另一个javascript文件中的某个功能,此时必须保证被依赖的那个javascript文件被加载,才能实现网页的某个功能,随着各个javascript文件或css文件间关系的错综复杂,采用此种解析方式,浏览器的崩溃概率也大大增加。发明内容[0004]针对现有技术中存在的缺陷,本发明的目的在于提供一种使用注解方式加载代码文件的方法和一种使用注解方式加载代码文件的系统,能够有效提高浏览器加载网页的速度。[0005]为达到以上目的,本发明采取的技术方案是,包括:[0006]步骤S1:下载代码文件至浏览器中并...

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
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/445
CPCG06F9/44521
Inventor 于立甫
Owner WUHAN DOUYU NETWORK TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More