CN103530152A - Method, device and terminal device for loading client-side scripts - Google Patents

Method, device and terminal device for loading client-side scripts Download PDF

Info

Publication number
CN103530152A
CN103530152A CN201310471056.0A CN201310471056A CN103530152A CN 103530152 A CN103530152 A CN 103530152A CN 201310471056 A CN201310471056 A CN 201310471056A CN 103530152 A CN103530152 A CN 103530152A
Authority
CN
China
Prior art keywords
client script
loaded
client
order
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201310471056.0A
Other languages
Chinese (zh)
Inventor
任远
姚丽梅
王宗妮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201310471056.0A priority Critical patent/CN103530152A/en
Publication of CN103530152A publication Critical patent/CN103530152A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method, device and terminal device for loading client-side scripts. The method includes the following steps that the sequence of the client-side scripts to be loaded is obtained; the client-side scripts to be loaded are loaded in parallel; the loaded client-side scripts are executed according to the obtained sequence in a serial mode. According to the method for loading the client-side scripts, the speed of loading the client-side scripts is increased through the parallel loading, and besides the sequence of executing the client-side scripts is guaranteed, so that efficiency of loading the client-side scripts is improved.

Description

A kind of method, device and terminal device that loads client script
Technical field
The disclosure relates to communication technical field, more specifically, relates to a kind of method, device and terminal device that loads client script.
Background technology
Along with the development of internet, the content on webpage becomes more and more abundanter.At present, increasing web site contents show depend on client script loading (for example, from server, download for example javascript script carries out to user's browser), it is more and more that the client script that need to download when user uses website also becomes thereupon.
Browser, when loading client script, continues to download and carry out after normally executing in order the client script of this download after download client script again.Yet, at present the influence to the construction of slower network infrastructure the speed of download client script, how quickly the client script in Web page loading becomes the problem that needs solve.
Summary of the invention
In view of this, object of the present disclosure is to propose a kind of method, device and terminal device that loads client script, can realize and load fast and efficiently client script.
On the one hand, the disclosure provides a kind of method that loads client script, and the method comprises the following steps:
Obtain the order of client script to be loaded;
The client script that Parallel download is to be loaded;
According to the order serial of obtaining, carry out the client script of having downloaded.
The method of the loading client script that the disclosure provides, by Parallel download client script, then the client script of downloading is carried out in serial, by Parallel download, promote the speed of download client script, guarantee again to carry out the order of client script, thereby promoted efficiency for loading client script.
As technique scheme preferably, before obtaining the order of client script to be loaded, described method also comprises: determine client script to be loaded.Then this programme obtains client script to be loaded the order of client script to be loaded, thereby raises the efficiency by first determining.
As technique scheme preferably, after determining client script to be loaded, described method also comprises: whether the quantity that judges client script to be loaded is more than or equal to 2; When the quantity of client script to be loaded is more than or equal to 2, obtain the order of client script to be loaded.In this programme, prejudge the quantity of current web page client script to be loaded, only have when the quantity of client script to be loaded is more than or equal to 2, just carry out the scheme of Parallel download, order execution, saved resource.
As technique scheme preferably, by the application programming interface that dynamically writes content to the page in DOM Document Object Model, realize described Parallel download client script to be loaded, and carry out according to the order serial of obtaining the step that the client script of having downloaded loads client script.This programme utilizes the application programming interface that dynamically writes content to the page in DOM Document Object Model to realize Parallel download client script, and the client script after downloading is carried out in serial, simple and easy to do.
On the other hand, the disclosure also provides a kind of device that loads client script, and described device comprises:
Acquisition module, for obtaining the order of client script to be loaded;
Download module, for Parallel download client script to be loaded;
Execution module, carries out the client script of having downloaded for the order serial according to obtaining.
As technique scheme preferably, described device also comprises:
Determination module, before obtaining the order of client script to be loaded, determines client script to be loaded.
As technique scheme preferably, described device also comprises:
Judge module, for judging whether the quantity of client script to be loaded is more than or equal to 2; When the quantity of client script to be loaded is more than or equal to 2, obtain the order of client script to be loaded.
As technique scheme preferably, described download module and execution module are realized by the application programming interface that dynamically writes content to the page in DOM Document Object Model.
On the other hand, the disclosure also provides a kind of terminal device, described terminal device includes storer, and one or more than one program, the above program of one of them or one is stored in storer, and is configured to carry out described one or above routine package containing for carrying out the instruction of following operation by one or above processor:
Obtain the order of client script to be loaded;
The client script that Parallel download is to be loaded;
According to the order serial of obtaining, carry out the client script of having downloaded.
Further feature of the present disclosure and advantage will be set forth in the following description, and, partly from instructions, become apparent, or understand by implementing the disclosure.Object of the present disclosure and other advantages can be realized and be obtained by specifically noted structure in the instructions write, claims and accompanying drawing.
Should be understood that, it is only exemplary that above general description and details are hereinafter described, and can not limit the disclosure.Below by drawings and Examples, technical scheme of the present disclosure is described in further detail.
Accompanying drawing explanation
Accompanying drawing is used to provide further understanding of the disclosure, and forms a part for instructions, is used from the explanation disclosure with embodiment mono-of the present disclosure, does not form restriction of the present disclosure.In the accompanying drawings:
Fig. 1 is the main method process flow diagram of the loading client script that provides of the disclosure;
Fig. 2 is the method flow diagram that in the disclosure, browser loads an embodiment of client script;
Fig. 3 is the method flow diagram that in the disclosure, browser loads another embodiment of client script;
Fig. 4 is the method flow diagram that in the disclosure, browser loads another embodiment of client script;
Fig. 5 is the structural representation of the device of the loading client script that provides of the disclosure;
Fig. 6 is another structural representation of the device of the loading client script that provides of the disclosure;
Fig. 7 is the structural representation of a kind of terminal device of providing of the disclosure.
By above-mentioned accompanying drawing, the embodiment that the disclosure is clear and definite has been shown, will there is more detailed description hereinafter.These accompanying drawings and text description are not in order to limit the scope of disclosure design by any mode, but by reference to specific embodiment for those skilled in the art illustrate concept of the present disclosure.
Embodiment
Below in conjunction with accompanying drawing, preferred embodiment of the present disclosure is described, should be appreciated that preferred embodiment described herein is only for the description and interpretation disclosure, and be not used in the restriction disclosure.
The method of the loading client script that the disclosure provides is mainly used in realizing in the terminal device of running browser.An embodiment who is illustrated in figure 1 the method for the loading client script that the disclosure provides, the method comprises the following steps:
In step S101, obtain the order of client script to be loaded, the method that the present embodiment provides is for terminal device.
In step S102, the client script that Parallel download is to be loaded.
In step S103, according to the order serial of obtaining, carry out the client script of having downloaded.
The method of the loading client script that the disclosure provides, by Parallel download client script, then the client script of downloading is carried out in serial, by Parallel download, promote the speed of download client script, guarantee again to carry out the order of client script, thereby promoted efficiency for loading client script.
Another embodiment that is illustrated in figure 2 the method for the loading client script that the disclosure provides, the method comprises the following steps:
In step S201, the terminal device of running browser detects by the request of a certain webpage of browser access, and the method that the present embodiment provides is for the terminal device of running browser.
For example, user wants by the browser access webpage A in mobile phone, and in the link of webpage clicking A or while inputting its network address, this mobile phone detects by the request of browser access webpage A.
In step S202, this terminal device sends the request of the web page files that obtains this webpage to server.
In step S203, the web page files that this terminal device reception server returns.
Server receives after the request of terminal device, and the web page files that terminal device is wanted to obtain sends to this terminal device.
In step S204, terminal device analyzing web page file, determines the client script that current web page is to be loaded.
In step S205, terminal device obtains the order of client script to be loaded.
In step S206, the client script that terminal device Parallel download is to be loaded.
In step S207, terminal device is carried out the client script of having downloaded according to the order serial of obtaining.
In the present embodiment, terminal device is determined client script to be loaded by analyzing web page file, then obtain the order of client script to be loaded, thereby realize Parallel download client script, the client script of downloading is carried out in serial in order, and the terminal device that therefore can promote on the whole running browser loads the efficiency of client script.
Another embodiment that is illustrated in figure 3 the method for the loading client script that the disclosure provides, the method comprises the following steps:
In step S301: the terminal device of running browser detects by the request of a certain webpage of browser access, and the method that the present embodiment provides is for the terminal device of running browser.
In step S302: this terminal device sends the request of this webpage to server.
In step S303: the web page files that this terminal device reception server returns.
In step S304: this terminal device analyzing web page file, determine the client script that current web page is to be loaded.
In step S305: this terminal device judges whether the quantity of the client script that current web page is to be loaded is more than or equal to 2; If so, perform step S306; If not, execution step S309.
In step S305: this terminal device obtains the order of client script to be loaded.
In step S307: the client script that this terminal device Parallel download is to be loaded.
In step S308: this terminal device is carried out the client script of having downloaded according to the order serial of obtaining.
In step S309: this terminal device is downloaded client script to be loaded and carried out.
In the present embodiment, the terminal device of running browser can be prejudged the quantity of current web page client script to be loaded, only have when the quantity of client script to be loaded is more than or equal to 2, just carry out the scheme of Parallel download, order execution, saved resource.
Another embodiment that is illustrated in figure 4 the method for the loading client script that the disclosure provides, the method comprises the following steps:
In step S401: the terminal device of running browser detects by the request of a certain webpage of browser access, and the method that the present embodiment provides is for the terminal device of running browser.
In step S402: this terminal device sends the request of this webpage to server.
In step S403: the web page files that this terminal device reception server returns.
In step S404: this terminal device analyzing web page file, determine the client script that current web page is to be loaded.
In step S405: this terminal device judges whether the quantity of the client script that current web page is to be loaded is more than or equal to 2; If so, perform step S406; If not, execution step S408.
In step S406: this terminal device obtains the order of client script to be loaded.
In step S407: this terminal device utilizes the application programming interface that dynamically writes content to the page in DOM Document Object Model to realize Parallel download client script and carry out the client script after downloading by the order of obtaining.
For example, the URL(Uniform Resource Locator of client script to be loaded in webpage, URL(uniform resource locator)) address is url1 and url2, after this step is carried out so, JavaScript(client script language of loading) code sample is as follows:
document.write(‘<script?src=”url1”></script>’)
document.write(‘<script?src=”url2”></script>’)
After above code is carried out, the terminal device of running browser meeting Parallel download url1, these two client scripts of url2, after all client scripts are downloaded, can be according to url1, the order of url2 is carried out content for script successively.Because, the DOM(Document Object Model of browser, DOM Document Object Model) document.write(in dynamically writes content to the page) API(Application Programming Interface, application programming interface) be for show one section of text on the page, and the output meeting of text show according to document.write order.In the present embodiment, utilize document.write to write one section of HTML code, and HTML code can be performed after output, the result of execution: first the client script Parallel download of the labeling requirement request of script in HTML, downloaded rear order execution.
In step S408: this terminal device is downloaded client script to be loaded and carried out.
In the present embodiment, utilize the document.write API in browser to realize Parallel download client script, the client script after downloading is carried out in serial, simple and easy to do.
Correspondingly, the disclosure also provides a kind of device that loads client script, and as shown in Figure 5, this device comprises:
Acquisition module 501, for obtaining the order of client script to be loaded;
Download module 502, for Parallel download client script to be loaded;
Execution module 503, carries out the client script of having downloaded for the order serial according to obtaining.
As shown in Figure 6, this device also comprises:
Determination module 504, before obtaining the order of client script to be loaded, determines client script to be loaded.
As shown in Figure 6, this device also comprises:
Judge module 505, for judging whether the quantity of client script to be loaded is more than or equal to 2; When the quantity of client script to be loaded is more than or equal to 2, obtain the order of client script to be loaded.
Wherein, download module 502 and execution module 503 are realized by the application programming interface that dynamically writes content to the page in perform document object model.
It should be noted that: when the device of the loading client script that above-described embodiment provides is stated function in realization, only the division with above-mentioned each functional module is illustrated, in practical application, can above-mentioned functions be distributed and by different functional modules, completed as required, the inner structure of the equipment of being about to is divided into different functional modules, to complete all or part of function described above.In addition, the device of the loading client script that above-described embodiment provides belongs to same design with the embodiment of the method that loads client script, and its specific implementation process refers to embodiment of the method, repeats no more here.
The disclosure also provides a kind of terminal device.Referring to Fig. 7, the method that this terminal device can obtain for the processing call of implementing to provide in above-described embodiment.Wherein, this terminal can be mobile phone, panel computer pad, Wearable mobile device (as intelligent watch) etc.Preferred:
Terminal device 700 can comprise communication unit 110, includes the storer 120 of one or more computer-readable recording mediums, input block 130, display unit 140, sensor 150, voicefrequency circuit 160, WiFi (wireless fidelity, Wireless Fidelity) module 170, include the parts such as or above processor 180 of processing core and power supply 190.It will be understood by those skilled in the art that the terminal device structure shown in Fig. 7 does not form the restriction to terminal device, can comprise the parts more more or less than diagram, or combine some parts, or different parts are arranged.Wherein:
Communication unit 110 can be used for receiving and sending messages or communication process in, the reception of signal and transmission, this communication unit 110 can be RF(Radio Frequency, radio frequency) circuit, router, modulator-demodular unit, etc. network communication equipment.Especially, when communication unit 110 is RF circuit, after the downlink information of base station is received, transfer to one or above processor 180 processing; In addition, by relating to up data, send to base station.Conventionally, RF circuit as communication unit includes but not limited to antenna, at least one amplifier, tuner, one or more oscillator, subscriber identity module (SIM) card, transceiver, coupling mechanism, LNA(Low Noise Amplifier, low noise amplifier), diplexer etc.In addition, communication unit 110 can also be by radio communication and network and other devices communicatings.Described radio communication can be used arbitrary communication standard or agreement, include but not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, Wideband Code Division Multiple Access (WCDMA)), LTE (Long Term Evolution, Long Term Evolution), Email, SMS (Short Messaging Service, Short Message Service) etc.Storer 120 can be used for storing software program and module, and processor 180 is stored in software program and the module of storer 120 by operation, thereby carries out various function application and data processing.Storer 120 can mainly comprise storage program district and storage data field, wherein, and the application program (such as sound-playing function, image player function etc.) that storage program district can storage operation system, at least one function is required etc.; The data (such as voice data, phone directory etc.) that create according to the use of terminal device 700 etc. can be stored in storage data field.In addition, storer 120 can comprise high-speed random access memory, can also comprise nonvolatile memory, for example at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, storer 120 can also comprise Memory Controller, so that the access of processor 180 and 130 pairs of storeies 120 of input block to be provided.
Input block 130 can be used for receiving numeral or the character information of input, and generation arranges with user and function is controlled relevant keyboard, mouse, control lever, optics or the input of trace ball signal.Preferably, input block 130 can comprise touch-sensitive surperficial 131 and other input equipments 132.Touch-sensitive surperficial 131, also referred to as touch display screen or Trackpad, can collect user or near touch operation (using any applicable object or near the operations of annex on touch-sensitive surperficial 131 or touch-sensitive surperficial 131 such as finger, stylus such as user) thereon, and drive corresponding coupling arrangement according to predefined formula.Optionally, touch-sensitive surperficial 131 can comprise touch detecting apparatus and two parts of touch controller.Wherein, touch detecting apparatus detects user's touch orientation, and detects the signal that touch operation is brought, and sends signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and converts it to contact coordinate, then gives processor 180, and the order that energy receiving processor 180 is sent is also carried out.In addition, can adopt the polytypes such as resistance-type, condenser type, infrared ray and surface acoustic wave to realize touch-sensitive surperficial 131.Except touch-sensitive surperficial 131, input block 130 can also comprise other input equipments 132.Preferably, other input equipments 132 can include but not limited to one or more in physical keyboard, function key (controlling button, switch key etc. such as volume), trace ball, mouse, control lever etc.
Display unit 140 can be used for showing the information inputted by user or the various graphical user interface of the information that offers user and terminal device 700, and these graphical user interface can consist of figure, text, icon, video and its combination in any.Display unit 140 can comprise display panel 141, optionally, can adopt the forms such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) to configure display panel 141.Further, touch-sensitive surperficial 131 can cover display panel 141, when touch-sensitive surperficial 131 detect thereon or near touch operation after, send processor 180 to determine the type of touch event, corresponding vision output is provided according to the type of touch event with preprocessor 180 on display panel 141.Although in Fig. 7, touch-sensitive surperficial 131 with display panel 141 be as two independently parts realize input and input function, in certain embodiments, can by touch-sensitive surperficial 131 and display panel 141 integrated and realize input and output function.
Terminal device 700 also can comprise at least one sensor 150, such as optical sensor, motion sensor and other sensors.Preferably, optical sensor can comprise ambient light sensor and proximity transducer, and wherein, ambient light sensor can regulate according to the light and shade of ambient light the brightness of display panel 141, proximity transducer can, when terminal device 700 moves in one's ear, cut out display panel 141 and/or backlight.A kind of as motion sensor; Gravity accelerometer can detect the size of the acceleration that (is generally three axles) in all directions; when static, can detect size and the direction of gravity, can be used for identifying application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as passometer, knock) of mobile phone attitude etc.; As for terminal device 700 other sensors such as configurable gyroscope, barometer, hygrometer, thermometer, infrared ray sensor also, do not repeat them here.
Voicefrequency circuit 160, loudspeaker 161, microphone 162 can provide the audio interface between user and terminal device 700.Voicefrequency circuit 160 can be transferred to loudspeaker 161 by the electric signal after the voice data conversion receiving, and is converted to voice signal exports by loudspeaker 161; On the other hand, microphone 162 is converted to electric signal by the voice signal of collection, after being received by voicefrequency circuit 160, be converted to voice data, after again voice data output processor 180 being processed, through RF circuit 110, to send to such as another terminal device, or export voice data to storer 120 to further process.Voicefrequency circuit 160 also may comprise earphone jack, so that communicating by letter of peripheral hardware earphone and terminal device 700 to be provided.
In order to realize radio communication, on this terminal device, can dispose wireless communication unit 170, this wireless communication unit 170 can be WiFi module.WiFi belongs to short range wireless transmission technology, terminal device 700 by wireless communication unit 170 can help that user sends and receive e-mail, browsing page and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 7 shows wireless communication unit 170, be understandable that, it does not belong to must forming of terminal device 700, completely can be as required in not changing the essential scope of invention and omit.
Processor 180 is control centers of terminal device 700, utilize the various piece of various interface and the whole mobile phone of connection, by moving or carry out software program and/or the module being stored in storer 120, and call the data that are stored in storer 120, carry out various functions and the deal with data of terminal device 700, thereby mobile phone is carried out to integral monitoring.Optionally, processor 180 can comprise one or more processing cores; Preferably, processor 180 can integrated application processor and modem processor, and wherein, application processor is mainly processed operating system, user interface and application program etc., and modem processor is mainly processed radio communication.Be understandable that, above-mentioned modem processor also can not be integrated in processor 180.
Terminal device 700 also comprises that the power supply 190(powering to all parts is such as battery), preferably, power supply can be connected with processor 180 logics by power-supply management system, thereby realizes the functions such as management charging, electric discharge and power managed by power-supply management system.Power supply 190 can also comprise the random component such as one or more direct current or AC power, recharging system, power failure detection circuit, power supply changeover device or inverter, power supply status indicator.
Although not shown, terminal device 700 can also comprise camera, bluetooth module etc., does not repeat them here.Specifically in the present embodiment, the display unit of terminal device is touch-screen display, terminal device also includes storer, and one or more than one program, the above program of one of them or one is stored in storer, and is configured to carry out described one or above routine package containing for carrying out the instruction of following operation by one or above processor:
Obtain the order of client script to be loaded;
The client script that Parallel download is to be loaded;
According to the order serial of obtaining, carry out the client script of having downloaded.
Preferably, in above-mentioned storer, also comprise for carrying out the instruction of following operation: before obtaining the order of client script to be loaded, determine client script to be loaded.
Preferably, in above-mentioned storer, also comprise for carrying out the instruction of following operation: after determining client script to be loaded, judge whether the quantity of client script to be loaded is more than or equal to 2; When the quantity of client script to be loaded is more than or equal to 2, obtain the order of client script to be loaded.
Preferably, in above-mentioned storer, also comprise for carrying out the instruction of following operation:
By the application programming interface that dynamically writes content to the page in DOM Document Object Model, realize described Parallel download client script to be loaded, and carry out according to the order serial of obtaining the step that the client script of having downloaded loads client script.
Visible, method, device and the terminal device of the loading client script that the disclosure provides, by obtaining the order of client script to be loaded, after Parallel download client script to be loaded, according to the order serial of obtaining, carry out the client script of having downloaded, promoted the speed of download client script, guarantee again to carry out the order of client script, thereby promoted efficiency for loading client script.
In addition, typically, the mobile terminal described in the disclosure can be various hand-held terminal devices, such as mobile phone, personal digital assistant (PDA) etc., and therefore protection domain of the present disclosure should not be defined as the mobile terminal of certain particular type.
In addition, according to method of the present disclosure, can also be implemented as the computer program of being carried out by CPU.When this computer program is carried out by CPU, carry out the above-mentioned functions limiting in method of the present disclosure.
In addition, said method step and system unit also can utilize controller and realize for storing the computer readable storage devices of the computer program that makes controller realize above-mentioned steps or Elementary Function.
In addition, should be understood that, computer readable storage devices as herein described (for example, storer) can be volatile memory or nonvolatile memory, or can comprise volatile memory and nonvolatile memory.And nonrestrictive, nonvolatile memory can comprise ROM (read-only memory) (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory as an example.Volatile memory can comprise random access memory (RAM), and this RAM can serve as External Cache storer.As an example and nonrestrictive, RAM can obtain in a variety of forms, such as synchronous random access memory (DRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate SDRAM (DDR SDRAM), enhancing SDRAM (ESDRAM), synchronization link DRAM (SLDRAM) and direct RambusRAM (DRRAM).The memory device of disclosed aspect is intended to include but not limited to the storer of these and other suitable type.
Those skilled in the art will also understand is that, in conjunction with the described various illustrative logical blocks of disclosure herein, module, circuit and algorithm steps, may be implemented as electronic hardware, computer software or both combinations.For this interchangeability of hardware and software is clearly described, with regard to the function of various exemplary components, square, module, circuit and step, it has been carried out to general description.This function is implemented as software or is implemented as hardware and depends on concrete application and the design constraint that imposes on whole system.Those skilled in the art can realize described function in every way for every kind of concrete application, but this realization determines should not be interpreted as causing departing from the scope of the present disclosure.
In conjunction with the described various illustrative logical blocks of disclosure herein, module and circuit, can utilize the following parts that are designed to carry out function described here to realize or carry out: general processor, digital signal processor (DSP), special IC (ASIC), field programmable gate array (FPGA) or other programmable logic device (PLD), discrete gate or transistor logic, discrete nextport hardware component NextPort or any combination of these parts.General processor can be microprocessor, but alternatively, processor can be any conventional processors, controller, microcontroller or state machine.Processor also may be implemented as the combination of computing equipment, and for example, the combination of DSP and microprocessor, multi-microprocessor, one or more microprocessor are in conjunction with DSP core or any other this configuration.
Step in conjunction with the described method of disclosure herein or algorithm can directly be included in the software module of carrying out in hardware, by processor or in the two combination.Software module can reside in the storage medium of RAM storer, flash memory, ROM storer, eprom memory, eeprom memory, register, hard disk, removable dish, CD-ROM or any other form known in the art.Exemplary storage medium is coupled to processor, make processor can be from this storage medium reading information or to this storage medium writing information.In an alternative, described storage medium can be integral to the processor together.Processor and storage medium can reside in ASIC.ASIC can reside in user terminal.In an alternative, processor and storage medium can be used as discrete assembly and reside in user terminal.
In one or more exemplary design, described function can realize in hardware, software, firmware or its combination in any.If realized in software, described function can be transmitted on computer-readable medium or by computer-readable medium as one or more instructions or code storage.Computer-readable medium comprises computer-readable storage medium and communication media, and this communication media comprises and contributes to computer program to be sent to from a position any medium of another position.Storage medium can be can be by any usable medium of universal or special computer access.As an example and nonrestrictive, this computer-readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disc memory apparatus, disk storage device or other magnetic storage apparatus, or can for carry or file layout be instruction or data structure required program code and can be by any other medium of universal or special computing machine or universal or special processor access.In addition, any connection can suitably be called computer-readable medium.For example, if use coaxial cable, optical fiber cable, twisted-pair feeder, digital subscriber line (DSL) or such as the wireless technology of infrared ray, radio and microwave come from website, server or other remote source send software, above-mentioned coaxial cable, optical fiber cable, twisted-pair feeder, DSL or include the definition at medium such as the wireless technology of infrared first, radio and microwave.As used herein, disk and CD comprise compact disk (CD), laser disk, CD, digital versatile disc (DVD), floppy disk, Blu-ray disc, disk rendering data magnetically conventionally wherein, and cd-rom using laser optics ground rendering data.The combination of foregoing also should be included in the scope of computer-readable medium.
Although disclosed content shows exemplary embodiment of the present disclosure above, it should be noted that under the prerequisite of the scope of the present disclosure that does not deviate from claim restriction, can carry out multiple change and modification.According to the function of the claim to a method of disclosed embodiment described herein, step and/or action, need not carry out with any particular order.In addition, although element of the present disclosure can be with individual formal description or requirement, also it is contemplated that a plurality of, unless be clearly restricted to odd number.
Above-described embodiment; object of the present disclosure, technical scheme and beneficial effect are further described; institute is understood that; the foregoing is only embodiment of the present disclosure; and be not used in and limit protection domain of the present disclosure; all within spirit of the present disclosure and principle, any modification of making, be equal to replacement, improvement etc., within all should being included in protection domain of the present disclosure.

Claims (9)

1. a method that loads client script, is characterized in that, described method comprises:
Obtain the order of client script to be loaded;
Client script to be loaded described in Parallel download;
According to the order serial of obtaining, carry out the client script of having downloaded.
2. method according to claim 1, is characterized in that, before obtaining the order of client script to be loaded, described method also comprises: determine client script to be loaded.
3. method according to claim 2, is characterized in that, after determining client script to be loaded, described method also comprises:
Whether the quantity that judges client script to be loaded is more than or equal to 2;
When the quantity of client script to be loaded is more than or equal to 2, obtain the order of client script to be loaded.
4. method according to claim 1, it is characterized in that, by the application programming interface that dynamically writes content to the page in DOM Document Object Model, realize described Parallel download client script to be loaded, and carry out according to the order serial of obtaining the step that the client script of having downloaded loads client script.
5. a device that loads client script, is characterized in that, described device comprises:
Acquisition module, for obtaining the order of client script to be loaded;
Download module, for client script to be loaded described in Parallel download;
Execution module, carries out the client script of having downloaded for the order serial according to obtaining.
6. device according to claim 5, is characterized in that, described device also comprises:
Determination module, before obtaining the order of client script to be loaded, determines client script to be loaded.
7. device according to claim 6, is characterized in that, described device also comprises:
Judge module, for judging whether the quantity of client script to be loaded is more than or equal to 2; When the quantity of client script to be loaded is more than or equal to 2, obtain the order of client script to be loaded.
8. device according to claim 5, is characterized in that, described download module and execution module are realized by the application programming interface that dynamically writes content to the page in DOM Document Object Model.
9. a terminal device, it is characterized in that, described terminal device includes storer, and one or more than one program, the above program of one of them or one is stored in storer, and is configured to carry out described one or above routine package containing for carrying out the instruction of following operation by one or above processor:
Obtain the order of client script to be loaded;
Client script to be loaded described in Parallel download;
According to the order serial of obtaining, carry out the client script of having downloaded.
CN201310471056.0A 2013-10-10 2013-10-10 Method, device and terminal device for loading client-side scripts Pending CN103530152A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310471056.0A CN103530152A (en) 2013-10-10 2013-10-10 Method, device and terminal device for loading client-side scripts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310471056.0A CN103530152A (en) 2013-10-10 2013-10-10 Method, device and terminal device for loading client-side scripts

Publications (1)

Publication Number Publication Date
CN103530152A true CN103530152A (en) 2014-01-22

Family

ID=49932192

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310471056.0A Pending CN103530152A (en) 2013-10-10 2013-10-10 Method, device and terminal device for loading client-side scripts

Country Status (1)

Country Link
CN (1) CN103530152A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572230A (en) * 2015-02-13 2015-04-29 小米科技有限责任公司 Script file loading method, script file generating method and script file generating device
CN109313558A (en) * 2016-06-14 2019-02-05 罗伯特·博世有限公司 Method for running computing unit
CN111224880A (en) * 2019-12-31 2020-06-02 北京健康之家科技有限公司 Interface data acquisition method and device for single-page application and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963987A (en) * 2010-09-30 2011-02-02 百度在线网络技术(北京)有限公司 Methods and equipments for generating and loading web page file

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101963987A (en) * 2010-09-30 2011-02-02 百度在线网络技术(北京)有限公司 Methods and equipments for generating and loading web page file

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
STEVE SOUDERS: "《Even faster web sites》", 30 June 2009 *
TU2047N: "高性能JavaScript编程", 《HTTP://WWW.DOC88.COM/P-633428059668.HTML》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572230A (en) * 2015-02-13 2015-04-29 小米科技有限责任公司 Script file loading method, script file generating method and script file generating device
CN104572230B (en) * 2015-02-13 2020-02-07 小米科技有限责任公司 Script file loading method and device and script file generating method and device
CN109313558A (en) * 2016-06-14 2019-02-05 罗伯特·博世有限公司 Method for running computing unit
CN111224880A (en) * 2019-12-31 2020-06-02 北京健康之家科技有限公司 Interface data acquisition method and device for single-page application and storage medium

Similar Documents

Publication Publication Date Title
CN103616983B (en) A kind of picture display method, device and terminal device
CN103501333A (en) Method, device and terminal equipment for downloading files
CN103543913A (en) Terminal device operation method and device, and terminal device
CN105320687A (en) Webpage display method and device
CN103678502B (en) Information collection method and device
CN103279574A (en) Method, device and terminal device for loading explorer pictures
CN103605668A (en) Webpage bookmark storing method and device and mobile terminal
CN104239332A (en) Webpage content processing method, webpage content processing device and browser client side
CN103513987A (en) Rendering treatment method, device and terminal device for browser web page
CN103687063B (en) A kind of method of interconnection network, device and terminal equipment
CN104298666A (en) Web page sharing method and web page sharing device
CN103617164B (en) Webpage prefetching method, device and terminal equipment
CN103607431B (en) Mobile terminal resource processing method, device and equipment
CN104104711A (en) Reading history processing method and device
CN104954159A (en) Network information statistics method and device
CN104267882A (en) Page suspension frame display method and device
CN103713943A (en) Native terminal operating system based application function realization method and device
CN103747130A (en) Control method of terminal equipment, device and terminal equipment
CN104135502A (en) Method of implementing application notification as well as associated equipment and system
CN103455601A (en) Webpage processing method and device, and terminal equipment
CN103631625A (en) Data acquisition method, user terminal, server and system
CN105530239A (en) Multimedia data obtaining method and device
CN104166646A (en) Method and device for inputting uniform resource locator
CN104751092A (en) Method and device for processing graphic code
CN103944922B (en) Data processing method, terminal, server and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140122

RJ01 Rejection of invention patent application after publication