Movatterモバイル変換


[0]ホーム

URL:


CN107797828A - The method and client of processing loading object - Google Patents

The method and client of processing loading object
Download PDF

Info

Publication number
CN107797828A
CN107797828ACN201711021475.9ACN201711021475ACN107797828ACN 107797828 ACN107797828 ACN 107797828ACN 201711021475 ACN201711021475 ACN 201711021475ACN 107797828 ACN107797828 ACN 107797828A
Authority
CN
China
Prior art keywords
code
loading object
loading
source code
data
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
CN201711021475.9A
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.)
Shenzhen Feng Cheng Powerise Technology Co Ltd
Original Assignee
Shenzhen Feng Cheng Powerise Technology Co Ltd
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 Shenzhen Feng Cheng Powerise Technology Co LtdfiledCriticalShenzhen Feng Cheng Powerise Technology Co Ltd
Priority to CN201711021475.9ApriorityCriticalpatent/CN107797828A/en
Publication of CN107797828ApublicationCriticalpatent/CN107797828A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The present invention provides a kind of method for handling loading object, method:Obtain Webpage source code;Judge whether perform data request code during the Webpage source code is loaded;If performing data request code during the Webpage source code is loaded, the loading object identification code pre-set is called;The loading object identification code is performed, loading object is shown on the page.The invention also discloses a kind of client, the method and client of processing loading object provided by the present invention, loading object can be shown by being multiplexed loading object identification code, avoid loading the redundancy of object identification code, reduce the difficulty of later stage code maintenance.

Description

The method and client of processing loading object
Technical field
The present invention relates to the communications field, more particularly to a kind of method and client for handling loading object.
Background technology
It is the scene often occurred in life by network downloading data with the popularization of network.Obtained by electronic equipmentTake Webpage, from Webpage downloading data when, it will usually show a loading object, with prompt the user with data download shapeState.Such as loading interface, animation or the progress bar shown during page download data, the annular shown when opening a WebpageProgress bar etc..At present during request of data, the form of display loading object is varied, but is all mostly by corresponding code listOnly controlled loading object shows and disappeared, and so, causes to load object identification code redundancy, later stage code maintenance is very cumbersome, complicated.
The content of the invention
It is a primary object of the present invention to solve existing loading object identification code redundancy, later stage code maintenance is very cumbersome, multipleThe problem of miscellaneous.
To achieve the above object, the present invention provides a kind of method for handling loading object, the side of the processing loading objectMethod includes:
Obtain Webpage source code;
Judge whether perform data request code during the Webpage source code is loaded;
If performing data request code during the Webpage source code is loaded, the loading pre-set is calledObject identification code;
The loading object identification code is performed, loading object is shown on the page.
Preferably, if described perform data request code during the Webpage source code is loaded, call pre-Also include before the step of loading object identification code first set:
The loading object identification code is set, and the loading object identification code includes the pattern parameter of loading object.
Preferably, it is described to perform the loading object identification code, also include after the step of loading object is shown on the page:
Judge whether request of data is completed;
If request of data is completed, the loading object is hidden.
Preferably, the step for judging whether to perform data request code during the Webpage source code is loadedSuddenly include:
Judge during the Webpage source code is loaded whether to server to send hypertext transfer protocol requests,The hypertext transfer protocol requests include the request method of data resource, the identifier of data resource;When in the loading netThe hypertext transfer protocol requests are sent to server during page page source code, then show loading the WebpageThe data request code is performed during source code, otherwise shows to be not carried out during the Webpage source code is loadedThe data request code.
Preferably, it is characterised in that it is described to perform the loading object identification code, the step of loading object is being shown on the pageAlso include afterwards:
Change the pattern parameter that object is loaded in the loading object identification code;Or
Delete the loading object identification code.
In addition, to achieve the above object, the present invention also provides a kind of client, and the client includes:
Acquisition module, for obtaining Webpage source code;
First judge module, for judging whether perform request of data generation during the Webpage source code is loadedCode;
Calling module, if for performing data request code during the Webpage source code is loaded, callThe loading object identification code pre-set;
Display module, for performing the loading object identification code, loading object is shown on the page.
Preferably, the client also includes:
Setup module, for setting the loading object identification code, the loading object identification code includes the pattern of loading objectParameter.
Preferably, the client also includes:
Second judge module, for judging whether request of data is completed;
Hidden module, if being completed for request of data, the loading object is hidden.
Preferably, first judge module, specifically it is additionally operable to judge during the Webpage source code is loadedWhether to server hypertext transfer protocol requests are sent, the hypertext transfer protocol requests include the requesting party of data resourceThe identifier of formula, data resource;Passed when sending the hypertext to server during the Webpage source code is loadedDefeated agreement request, then show to perform the data request code during the Webpage source code is loaded, otherwise showThe data request code is not carried out during the Webpage source code is loaded.
Preferably, the client also includes:
Modified module, the pattern parameter of object is loaded in the loading object identification code for changing;Or
Removing module, for deleting the loading object identification code.
The method and client of processing loading object provided by the invention, by being multiplexed loading object identification code to loading objectIt has been shown that, avoid loading the redundancy of object identification code, reduce the difficulty of later stage code maintenance, can largely reduce generation in later stageThe human cost and time cost that code is safeguarded.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the embodiment of method one of the processing loading object of the present invention;
The schematic flow sheet of another embodiment of method of the processing loading object of Fig. 2 present invention;
Fig. 3 is the high-level schematic functional block diagram of the embodiment of client one of the present invention;
Fig. 4 is the high-level schematic functional block diagram of another embodiment of client of the present invention;
Fig. 5 is the high-level schematic functional block diagram of another embodiment of client of the present invention;
Fig. 6 is the high-level schematic functional block diagram of another embodiment of client of the present invention.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that preferred embodiment described herein is merely to illustrate and explain the present invention, it is not used to limit thisInvention.
Referring to Fig. 1, Fig. 1 is a kind of flow chart of method for handling loading object provided in an embodiment of the present invention, such as Fig. 1 institutesShow, the method for the processing loading object comprises the following steps:
Step S10, Webpage source code is obtained.
In the above-described embodiments, the Webpage source code can be JS (JavaScript, Java script).It can pass throughWLAN obtains Webpage source code, can also obtain Webpage source code by mobile data.Webpage source codeIt can be the source code of the Webpages such as the video playback page, news pages, application program loading page.
By performing Webpage source code, corresponding Webpage can be generated.For example, if Webpage source code is videoPage source code is played, the video playback page is produced according to video playback page source code, video can be shown in the video playback pageData.
Step S20, judge whether perform data request code during the Webpage source code is loaded.
In the above-described embodiments, the data request code can be the code for including hypertext transfer protocol requests, pass throughDigital resource can be asked to server by performing data request code, for example, video data resource, voice data money can be askedSource etc..
In the above-described embodiments, if performing data request code during the Webpage source code is loaded, needThe data resource for wanting the reception server to return, thus need to show loading object, the loading object is used to prompt the user with numberAccording to the state of resource downloading, specifically, loading object can be time schedule bar, can include information such as " loading "Textbox or animation or picture etc..Please if being not carried out data during the Webpage source code is loadedCode is sought, then the data resource for not needing the reception server to return, it is not necessary to display loading object.
Optionally, in above-described embodiment, step S20 specifically may comprise steps of:Judge loading the webpage pageWhether include counting to server transmission hypertext transfer protocol requests, the hypertext transfer protocol requests during the source code of faceAccording to the request method of resource, the identifier of data resource;When being sent out during the Webpage source code is loaded to serverThe hypertext transfer protocol requests are sent, then show to perform the request of data during the Webpage source code is loadedCode, otherwise show to be not carried out the data request code during the Webpage source code is loaded.
Specifically, please if sending HTTP to server during the Webpage source code is loadedAsk, then show to perform the data request code, it is necessary to which the reception server is returned during the Webpage source code is loadedThe data resource returned, the data resource of the return are the data resource determined according to the identifier of data resource.Waiting number, it is necessary to call loading object identification code during according to resource, to complete showing the step of loading object on the page.The loadingObject can prompt the user with the state of data download, and specifically, loading object can be time schedule bar, can includeThe textbox or animation of information such as " loading " or picture etc..If loading the mistake of the Webpage source codeCheng Zhongwei sends hypertext transfer protocol requests to server, then shows not hold during the Webpage source code is loadedThe row data request code, it is not necessary to the data resource that the reception server returns, it is not necessary to call loading object identification code.
Step S30, if performing data request code during the Webpage source code is loaded, calling is set in advanceThe loading object identification code put.
In the above-described embodiments, the pattern of the loading object in the loading object identification code pre-set can be by super literaryThis markup language (HyperText Markup Language, HTML) and CSS (Cascading StyleSheets, CSS) set loading object style.
In the above-described embodiments, the loading object identification code pre-set is called, it is possible to reduce code redundancy, load object generationThe later maintenance process of code is also fairly simple.A loading object identification code can is pre-set in different Webpages to enterRow calls, it is possible to reduce the written in code time.
Supplementary notes, before step S30, loading object identification code can be set, in the loading object identification code of settingPattern parameter including loading object, pattern parameter can be changed, if different pattern parameters is set, by performing loadingObject identification code can generate the different loading object of pattern, for example, animation, picture, word, timeline and Progress box can be setDeng the pattern of loading object.
Step S40, the loading object identification code is performed, loading object is shown on the page.
In the above-described embodiments, when performing loading object identification code, it can read in loading object identification code and load objectPattern parameter, object is loaded according to corresponding to the production of pattern parameter, specifically, loading object can be needed for loading dataTimeline, downloading data percentage Progress box, animation or word etc..Loading object is shown on the page, user can be allowed to knowTrack data download progress, meets user's request.
Optionally, after the step s 40, loading object identification code can be adjusted.Specifically, loading can be changedThe pattern parameter of object is loaded in object identification code.Changed by customized pattern parameter, load object identification code after being performed,The loading object with different patterns can be generated.The adjustment of loading object identification code is also included deleting loading object identification code, for example,In later stage code maintenance, it is not necessary to when loading object identification code, can once delete loading object identification code, simplify later stage deletion loadingThe operation of object identification code.The method for the processing loading object that above example provides can apply to the shifting such as mobile phone, tablet personal computerDynamic terminal, the platforms such as website can also be applied to.
Referring to Fig. 2, Fig. 2 is the schematic flow sheet of another embodiment of method of the processing loading object of the present invention.Fig. 2 institutesIt is the embodiment after being improved based on embodiment illustrated in fig. 1 to show embodiment, is theed improvement is that, in the step S40 shown in Fig. 1Step S50 and S60 are added afterwards, wherein:
Step S50, judge whether request of data is completed.
In the above-described embodiments, if request of data is completed, explanation need not show loading object, it is necessary to enter to loading objectRow is hidden.Specifically, after service end returns to all data, determine that request of data is completed.
If step 60, request of data are completed, the loading object is hidden.
In the present embodiment, if request of data is completed, after loading object is hidden, the display in the page can be simplifiedObject, improve the visual effect of the page.Specifically, the visual attribute of the loading object can be arranged to see thisState, to complete the hiding operation to loading object.
The method for the processing loading object that above example provides, is carried out by being multiplexed loading object identification code to loading objectIt has been shown that, avoid loading the redundancy of object identification code, reduce the difficulty of later stage code maintenance, can largely reduce later stage code dimensionThe human cost and time cost of shield.
The present invention further provides a kind of client.Fig. 3 is the functional module signal of the embodiment of client one of the present inventionFigure.In this embodiment, client 100 includes:Acquisition module 101, the first judge module 102, calling module 103 and display mouldBlock 104.Wherein, acquisition module 101 is used to obtain Webpage source code.First judge module 102 is used to judge described in loadingWhether data request code is performed during Webpage source code.If calling module 103 is used to load the WebpageData request code is performed during source code, then calls the loading object identification code pre-set.Display module 104 is used to performThe loading object identification code, loading object is shown on the page.
In the above-described embodiments, the Webpage source code can be JS (JavaScript, Java script).Acquisition module101 can obtain Webpage source code by WLAN, can also obtain Webpage source code by mobile data.NetPage page source code can be the source code of the Webpages such as the video playback page, news pages, application program loading page.By holdingThe Webpage source code that row acquisition module 101 obtains, can generate corresponding Webpage.For example, if Webpage source code isVideo playback page source code, the video playback page is produced according to video playback page source code, can be shown in the video playback pageVideo data.
In the above-described embodiments, the data request code can be the code for including hypertext transfer protocol requests, visitorFamily end 100 can ask digital resource by performing data request code to server, for example, video data can be asked to provideSource, voice data resource etc..
In the above-described embodiments, if performing data request code during the Webpage source code is loaded, needThe data resource that the reception server returns is wanted, it is necessary to show loading object, the loading object is used to prompt the user with dataThe state of load, specifically, loading object can be time schedule bar, can be the word for including information such as " loading "Frame or animation or picture etc..If being not carried out data request code during the Webpage source code is loaded,The data resource for not needing then the reception server to return, it is not necessary to display loading object.
Whether the first judge module 102 is specifically additionally operable to judge during the loading Webpage source code to serviceDevice sends hypertext transfer protocol requests, and the hypertext transfer protocol requests include the request method of data resource, data moneyThe identifier in source;Please when sending the HTTP to server during the Webpage source code is loadedAsk, then show to perform the data request code during the Webpage source code is loaded, otherwise show in loading instituteThe data request code is not carried out during stating Webpage source code.
Specifically, please if sending HTTP to server during the Webpage source code is loadedAsk, then show to perform the data request code, it is necessary to which the reception server is returned during the Webpage source code is loadedThe data resource returned, the data resource of the return are the data resource determined according to the identifier of data resource.Waiting number, it is necessary to call loading object identification code during according to resource, to complete showing the step of loading object on the page.The loadingObject can prompt the user with the state of data download, and specifically, loading object can be time schedule bar, can includeThe textbox or animation of information such as " loading " or picture etc..If loading the mistake of the Webpage source codeCheng Zhongwei sends hypertext transfer protocol requests to server, then shows not hold during the Webpage source code is loadedThe row data request code, it is not necessary to the data resource that the reception server returns, it is not necessary to call loading object identification code.
In the above-described embodiments, the pattern of the loading object in the loading object identification code pre-set can be by super literaryThis markup language (Hyper Text Markup Language, HTML) and CSS (Cascading StyleSheets, CSS) set loading object style.
In the above-described embodiments, calling module 103 calls the loading object identification code pre-set, it is possible to reduce code is superfluousIt is remaining, it is also fairly simple to the later maintenance process of loading object identification code.Pre-set a loading object identification code, calling module103 cans are called in different Webpages, it is possible to reduce the written in code time.
In the above-described embodiments, display module 104 can be read in loading object identification code when performing loading object identification codeThe pattern parameter of object is loaded, object is loaded according to corresponding to the production of pattern parameter, specifically, loading object can be loadingTime needed for data, downloading data percentage Progress box etc..Loading object is shown on the page, number can be let the user know thatAccording to download progress, meet user's request.
Referring to Fig. 4, Fig. 4 is the high-level schematic functional block diagram of another embodiment of client of the present invention.Embodiment illustrated in fig. 4It is the embodiment after being improved based on embodiment illustrated in fig. 3, thes improvement is that, increases in the client 100 shown in Fig. 1Setup module 105, wherein:
Setup module 105 is used to set the loading object identification code, and the loading object identification code includes the sample of loading objectFormula parameter.
Specifically, setup module 105 can set loading object identification code, the loading object of setting by self-defined modeCode includes loading the pattern parameter of object, and pattern parameter can be changed, if different pattern parameters is set, by holdingRow loading object identification code can generate the different loading object of pattern, for example, can set animation, picture, word, timeline andProgress box etc. loads the pattern of object.
Referring to Fig. 5, Fig. 5 is the high-level schematic functional block diagram of another embodiment of client of the present invention.Embodiment illustrated in fig. 5It is the embodiment after being improved based on embodiment illustrated in fig. 3, thes improvement is that, increases in the client 100 shown in Fig. 1Second judge module 106 and hidden module 107, wherein:
Second judge module 106 is used to judge whether request of data is completed, if hidden module 107 is complete for request of dataInto, then by it is described loading object be hidden.
In the above-described embodiments, if request of data is completed, explanation need not show loading object, it is necessary to enter to loading objectRow is hidden.Specifically, after service end returns to all data, determine that request of data is completed.In the present embodiment, if data pleaseCompletion is asked, after loading object is hidden, the display object in the page can be simplified, improve the visual effect of the page.SpecificallyFor, the visual attribute of the loading object can be arranged to invisible mode, to complete the hiding behaviour to loading objectMake.
Referring to Fig. 6, Fig. 6 is the high-level schematic functional block diagram of another embodiment of client of the present invention.Embodiment illustrated in fig. 6It is the embodiment after being improved based on embodiment illustrated in fig. 3, thes improvement is that, increases in the client 100 shown in Fig. 1Adjusting module 108, wherein:
Adjusting module 108 is used to change the pattern parameter for loading object in the loading object identification code, or for deletingThe loading object identification code.
Specifically, adjusting module 108 can be used in modification loading object identification code the pattern parameter for loading object.Pass throughCustomized pattern parameter modification, loading object identification code can generate the loading object with different patterns after being performed.AdjustMould preparation block 108 can be also used for deleting loading object identification code, for example, in later stage code maintenance, it is not necessary to when loading object identification code,Loading object identification code can be once deleted, simplifies the operation of later stage deletion loading object identification code.
The client that above example provides, loading object is shown by being multiplexed loading object identification code, avoids addingCarry the redundancy of object identification code, reduce the difficulty of later stage code maintenance, can largely reduce the manpower of later stage code maintenance intoSheet and time cost.
The preferred embodiments of the present invention are these are only, are not intended to limit the scope of the invention, it is every to utilize this hairThe equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skillsArt field, is included within the scope of the present invention.

Claims (10)

CN201711021475.9A2017-10-262017-10-26The method and client of processing loading objectPendingCN107797828A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201711021475.9ACN107797828A (en)2017-10-262017-10-26The method and client of processing loading object

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201711021475.9ACN107797828A (en)2017-10-262017-10-26The method and client of processing loading object

Publications (1)

Publication NumberPublication Date
CN107797828Atrue CN107797828A (en)2018-03-13

Family

ID=61547953

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201711021475.9APendingCN107797828A (en)2017-10-262017-10-26The method and client of processing loading object

Country Status (1)

CountryLink
CN (1)CN107797828A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108628615A (en)*2018-03-222018-10-09阿里巴巴集团控股有限公司A kind of discarded code detection method, device and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20110115914A1 (en)*2009-11-102011-05-19Clear-View-Technologies, Inc.Sequential Hardware Event Processor with Video Event Compression and Recall
CN102799678A (en)*2012-07-232012-11-28深圳市同洲电子股份有限公司Method for customizing progress bar of browser and method for customizing error page of browser
CN104778055A (en)*2014-01-152015-07-15腾讯科技(深圳)有限公司Method and device for displaying progress bar
WO2016161922A1 (en)*2015-04-092016-10-13腾讯科技(深圳)有限公司Video file processing method and device
CN107222776A (en)*2017-05-192017-09-29腾讯科技(深圳)有限公司Video playing control method, browser, storage device and terminal
CN107273275A (en)*2017-05-092017-10-20武汉斗鱼网络科技有限公司Progress bar dynamic refresh method and device in a kind of multiple data cells

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20110115914A1 (en)*2009-11-102011-05-19Clear-View-Technologies, Inc.Sequential Hardware Event Processor with Video Event Compression and Recall
CN102799678A (en)*2012-07-232012-11-28深圳市同洲电子股份有限公司Method for customizing progress bar of browser and method for customizing error page of browser
CN104778055A (en)*2014-01-152015-07-15腾讯科技(深圳)有限公司Method and device for displaying progress bar
WO2016161922A1 (en)*2015-04-092016-10-13腾讯科技(深圳)有限公司Video file processing method and device
CN107273275A (en)*2017-05-092017-10-20武汉斗鱼网络科技有限公司Progress bar dynamic refresh method and device in a kind of multiple data cells
CN107222776A (en)*2017-05-192017-09-29腾讯科技(深圳)有限公司Video playing control method, browser, storage device and terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108628615A (en)*2018-03-222018-10-09阿里巴巴集团控股有限公司A kind of discarded code detection method, device and equipment
CN108628615B (en)*2018-03-222022-03-04创新先进技术有限公司Method, device and equipment for detecting abandoned codes

Similar Documents

PublicationPublication DateTitle
CN101697156B (en)A kind of method and system of constructing chain web pages
CN107622135A (en)Method and apparatus for display information
CN104144357B (en)Video broadcasting method and system
US20110228763A1 (en)Method and apparatus for accessing services of a device
CN106339414A (en)Webpage rendering method and device
CN110928767A (en)Webpage analysis method, device, equipment and storage medium
CN110780868A (en) Web site development method, device, device and storage medium based on componentized template
WO2012155678A1 (en)Method and terminal for developing mobile phone application interface based on browser parsing manner
CN107181803A (en)Method and apparatus for playing video
CN102724586A (en)Page caching method and page caching system based on internet protocol television (IPTV)
CN114138372A (en)Front-end component loading method and device
CN106446299A (en)Website information downloading method and device
JP2023537767A (en) Image processing method and apparatus, and computer-readable storage medium
CN112449250B (en)Method, device, equipment and medium for downloading video resources
CN106487662B (en)Information sharing method and device
CN105956173A (en)Page content acquisition method and apparatus
CN105224611A (en)Based on the operation processing method of browser, device and browser
CN102724169B (en)A kind of background framework and control system for moving advertising system
CN105243088B (en) Method and device for obtaining web page content in Android system
CN107797828A (en)The method and client of processing loading object
CN104050165B (en)A kind of webpage initial focus method for selecting and device based on IPTV
CN109343908A (en) A method and device for delay loading JS script
GB2478767A (en)Accessing services of a device
CN101964742A (en)Method, system and device for using network open ability
CN105025065A (en)Method, apparatus and system of converting Web station into Web application

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20180313

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp