Dynamically loading scripts
First Claim
1. At a computer system including a processor and system memory, the computer system connected to a network, the computer system including a Web browser configured to render Web pages at the computer system, the Web browser having a default script loading behavior that is used to load client-side scripts at the Web browser, the client-side scripts for generating content at the computer system that is to be included in Web pages rendered by the Web browser, a method for rendering a Web page at the Web browser, the method comprisingan act of receiving a Web page from a Web server, the Web page including static content, a reference to a client-side script loader script, and references to a plurality of other client-side scripts, the client-side script loader script configured to, upon execution, create a data structure for queuing the references to the plurality of other client-side scripts, the client-side script loader script also configured to, upon an indication from the Web browser, load the plurality of other client-side scripts in accordance with script loading rules, the script loading rules including loading rule logic configured to load the plurality of other client-side scripts based on identified characteristics of the plurality of other client-side scripts and based on identified relationships between any of the plurality of other client-side scripts so as to override the default script loading behavior of the Web browser;
- an act of the processor executing the client-side script loader script to create a data structure at the computer system, the data structure for storing the references to the plurality of other client-side scripts;
an act of the client-script loader script processing the Web page to enumerate the references to the plurality of other client-side scripts;
an act of the processor storing the enumerated references in the data structure;
an act of detecting that no further script references are included in the Web page subsequent to storing the enumerated references in the data structure;
an act of the client-side script loader script referring to the enumerated references to create a script load order for the plurality of other client-side scripts to cause the plurality of other client-side scripts to load in parallel, the script load order based on the loading rule logic, the script load order differing from the order in which the references to the plurality of other client-side scripts were encountered during enumeration;
an act of loading the plurality of other client-side scripts in parallel in accordance with the script load order to generate client-side content for inclusion in the Web page; and
an act of using the static content and the generated client-side content in a rendering of the Web page.
2 Assignments
0 Petitions
Accused Products
Abstract
The present invention extends to methods, systems, and computer program products for dynamically loading scripts. Web pages can include references to script loaders that control the loading of other scripts at a Web browser. A script loader can load scripts in accordance with script loading rules that override the default script loading behavior of the Web browser. Script loading rules can cause scripts to load in a different order than encountered in a Web pager, load in parallel, load in a manner that limits cross-domain requests, etc. Script loading rules are configurable such at that a developer can create customized script loading behavior.
-
Citations
15 Claims
-
1. At a computer system including a processor and system memory, the computer system connected to a network, the computer system including a Web browser configured to render Web pages at the computer system, the Web browser having a default script loading behavior that is used to load client-side scripts at the Web browser, the client-side scripts for generating content at the computer system that is to be included in Web pages rendered by the Web browser, a method for rendering a Web page at the Web browser, the method comprising
an act of receiving a Web page from a Web server, the Web page including static content, a reference to a client-side script loader script, and references to a plurality of other client-side scripts, the client-side script loader script configured to, upon execution, create a data structure for queuing the references to the plurality of other client-side scripts, the client-side script loader script also configured to, upon an indication from the Web browser, load the plurality of other client-side scripts in accordance with script loading rules, the script loading rules including loading rule logic configured to load the plurality of other client-side scripts based on identified characteristics of the plurality of other client-side scripts and based on identified relationships between any of the plurality of other client-side scripts so as to override the default script loading behavior of the Web browser; -
an act of the processor executing the client-side script loader script to create a data structure at the computer system, the data structure for storing the references to the plurality of other client-side scripts; an act of the client-script loader script processing the Web page to enumerate the references to the plurality of other client-side scripts; an act of the processor storing the enumerated references in the data structure; an act of detecting that no further script references are included in the Web page subsequent to storing the enumerated references in the data structure; an act of the client-side script loader script referring to the enumerated references to create a script load order for the plurality of other client-side scripts to cause the plurality of other client-side scripts to load in parallel, the script load order based on the loading rule logic, the script load order differing from the order in which the references to the plurality of other client-side scripts were encountered during enumeration; an act of loading the plurality of other client-side scripts in parallel in accordance with the script load order to generate client-side content for inclusion in the Web page; and an act of using the static content and the generated client-side content in a rendering of the Web page. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer program product at a computer system, the computer system connected to a network, the computer system including a Web browser configured to render Web pages at the computer system, the Web browser having a default script loading behavior that is used to load client-side scripts at the Web browser, the client-side scripts for generating content at the computer system that is to be included in Web pages rendered by the Web browser, the computer program product for implementing a method for rendering a Web page at the Web browser, the computer program product comprising one or more non-transitory computer-readable storage media having stored thereon computer-executable instructions that, when executed at a processor, cause the computer system to perform the method, including the following:
-
receive a Web page from a Web server, the Web page including static content, a reference to a client-side script loader script, and references to a plurality of other client-side scripts, the client-side script loader script configured to, upon execution, create a data structure for queuing the references to plurality of other client-side scripts, the client-side script loader script also configured to, upon an indication from the Web browser, load the plurality of other referenced client-side scripts in accordance with script loading rules, the script loading rules including loading rule logic configured to load the plurality of other client-side scripts based on identified characteristics of the plurality of other client-side scripts and based on identified relationships between any of the plurality of other client-side scripts so as to override the default script loading behavior of the Web browser; execute the client-side script loader script to create a data structure at the computer system, the data structure for storing the references to the plurality of other client-side scripts; process the Web page to enumerate the references to the plurality of other client-side scripts; store the enumerated references in the data structure; detect that no further script references are included in the Web page subsequent to storing the enumerated references in the data structure; refer to the enumerated references to create a script load order for the plurality of other client-side scripts to cause the plurality of other client-side scripts to load in parallel, the script load order based on the loading rule logic, the script load order differing from the order in which the references to the plurality of other client-side scripts were encountered during enumeration; an act of loading the plurality of other client-side scripts in parallel in accordance with the script load order to generate client-side content for inclusion in the Web page; and an act of using the static content and the generated client-side content in a rendering of the Web page. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A computer system, the computer system comprising:
-
system memory; one or more processors; and one or more computer-readable storage media having stored thereon computer-executable instructions representing a Web browser and a script processor, the Web browser having a default script loading behavior that is used to load client-side scripts at the Web browser, wherein the Web browser is configured to; receive a Web page from a Web server, the Web page including static content, a reference to a client-side script loader script, and references to a plurality of other client-side scripts, the client-side script loader script configured to, upon execution, create a data structure for queuing the references to the plurality of other client-side scripts, the client-side script loader script also configured to, upon an indication from the Web browser, load the plurality of other referenced client-side scripts in accordance with script loading rules, the script loading rules including loading rule logic configured to load the plurality of other client-side scripts based on identified characteristics of the plurality of other client-side scripts and based on identified relationships between any of the plurality of other client-side scripts so as to override the default script loading behavior of the Web browser; encounter the client-side script loader script within the Web page; pass the client-side script loader script to the script processor; receive client-side content generated by the plurality of other client-side scripts; and use the static content and the generated client-side content in a rendering of the Web page; and wherein the script processor is configured to; load the client-side script loader script, loading client-side script loader script causing the computer system to; create a data structure at the computer system, the data structure for storing the references to the plurality of other client-side scripts; process the Web page to enumerate the references to the plurality of other client-side scripts; store the enumerated references in the data structure; detect that no further script references are included in the Web page subsequent to storing the enumerated references in the data structure; and refer to the enumerated references to create a script load order for the plurality of other client-side scripts to cause the plurality of other client-side scripts to load in parallel, the script load order based on the loading rule logic, the script load order differing from the order in which the references to the plurality of other client-side scripts were encountered during enumeration; and load the plurality of other client-side scripts in parallel in accordance with the script load order to generate client-side content for inclusion in the Web page; and pass the generated client-side content to the Web browser for rendering in the Web page. - View Dependent Claims (12, 13, 14, 15)
-
Specification