主权项 |
1. A method, comprising:
at a client device that includes a processor, a memory, and a network interface device:
transmitting, to a web server and via the network interface device, a Hypertext Transfer Protocol (HTTP) request message, wherein:
the HTTP request message indicates a Uniform Resource Locator (URL) for a single page application (SPA);the SPA is part of a web application that includes multiple SPAs;the SPA comprises a global module that is common to the multiple SPAs in the web application and a child module that is specific to the SPA; anda portion of the URL is a child module identifier that uniquely identifies the SPA within the web application;receiving, from the web server and via the network interface device, one or more HTTP response messages, wherein the HTTP response messages include:
Javascript code that defines the global module;Javascript code that defines the child module; anda child module configuration object that includes configuration data for the child module;loading the global module; andloading the child module, wherein the loading the child module includes:
using the child module identifier to obtain a reference to the child module configuration object;initializing the child module; andconfiguring the child module based on the child module configuration object. |