CN104239407B - A kind of method and apparatus for showing webpage - Google Patents
A kind of method and apparatus for showing webpage Download PDFInfo
- Publication number
- CN104239407B CN104239407B CN201410373296.1A CN201410373296A CN104239407B CN 104239407 B CN104239407 B CN 104239407B CN 201410373296 A CN201410373296 A CN 201410373296A CN 104239407 B CN104239407 B CN 104239407B
- Authority
- CN
- China
- Prior art keywords
- attribute
- webpage
- code
- web page
- multiple labels
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9577—Optimising the visualization of content, e.g. distillation of HTML documents
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/972—Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The disclosure is directed to a kind of method and apparatus for showing webpage, belong to Internet technical field.The method includes:Receive web page code and the attribute scripted code that server is sent;The web page code is performed, to open the basic framework of webpage;Wherein, multiple labels are included in the webpage, the specific label property value of the multiple label is not included in the web page code, the attribute scripted code is used to set the specific label attribute for the multiple labels for being not provided with specific label attribute in the web page code;The attribute scripted code is performed, to set the specific label attribute of multiple labels described in the basic framework of the webpage, and shows the webpage after setting specific label attribute.Using the disclosure, it is possible to reduce network resources waste.
Description
Technical field
This disclosure relates to Internet technical field, more particularly to a kind of method and device for showing webpage.
Background technology
With the development of Internet technology, the content in webpage becomes increasingly to enrich, and at the same time browser needs to add
The web data from server carried also becomes more and more, and with the arrival in mobile Internet epoch, more and more
User begin to use mobile terminal equipment browse webpage, how in the case where not influencing user's browsed web content, subtract
The loading velocity of webpage is accelerated in the transmission of few web data, becomes the direction of technical staff's research.
The method that some data volumes for reducing web data are provided in the relevant technologies, will need to pass in advance in server end
The symbol that newline, tab, space in defeated web page code etc. do not influence webpage content display removes, unnecessary to reduce
Data transmission.
Above-mentioned the relevant technologies have at least the following problems:
The compressed webpage data by the way of additional character is removed, compression effectiveness unobvious, usually the method can
It is very limited with the ratio of compression, so, by the above method, treated that web data still has that data volume is larger to ask
Topic, so as to cause the data volume transmitted in web page loading process excessive, cause network resources waste.
Invention content
In order to solve the problems, such as the relevant technologies, present disclose provides a kind of method and apparatus for showing webpage.Institute
It is as follows to state technical solution:
According to the embodiment of the present disclosure in a first aspect, provide it is a kind of show webpage method, the method includes:
Receive web page code and the attribute scripted code that server is sent;
The web page code is performed, to open the basic framework of webpage;
Wherein, multiple labels are included in the webpage, the specific mark of the multiple label is not included in the web page code
Property value is signed, the attribute scripted code is used to set for the multiple labels for being not provided with specific label attribute in the web page code
Put the specific label attribute;
The attribute scripted code is performed, to set the specific label of multiple labels described in the basic framework of the webpage
Attribute, and show the webpage after setting specific label attribute.
Optionally, it is described to receive web page code and the attribute scripted code that server is sent, including:
Receive the web page code for including attribute scripted code that server is sent;
Or, the web page code that server is sent is received, corresponding category is obtained to the server according to the web page code
Property scripted code.
Optionally, it is described to perform the attribute scripted code, to set multiple marks described in the basic framework of the webpage
The specific label attribute of label, including:
Perform the first script sentence in the attribute scripted code;
First script sentence is used for the multiple labels that will have the first tag name in the basic framework of the webpage
First tag attributes are set as identical preset attribute value.
Optionally, it is described to perform the attribute scripted code, to set multiple marks described in the basic framework of the webpage
The specific label attribute of label, including:
Perform the second script sentence in the attribute scripted code;
Second script sentence is used for the multiple labels that will have the second tag name in the basic framework of the webpage
Second tag attributes are respectively set to multiple and different preset attribute values.
Optionally,
Second script sentence is additionally operable to:To there are multiple labels of the second tag name in the basic framework of the webpage
The second tag attributes be respectively set to preset value in preset group;Wherein, each preset value in the preset group point
Not Dui Ying in multiple labels with the second tag name each label the second tag attribute values.
According to the second aspect of the embodiment of the present disclosure, a kind of device for showing webpage is provided, described device includes:
Receiving module, for receiving the web page code and attribute scripted code of server transmission;
First execution module, for performing the web page code that the receiving module receives, to open the basic of webpage
Frame;
Wherein, multiple labels are included in the webpage, the specific mark of the multiple label is not included in the web page code
Property value is signed, the attribute scripted code is used to set for the multiple labels for being not provided with specific label attribute in the web page code
Put the specific label attribute;
Second execution module, for performing the attribute scripted code that the receiving module receives, to set described the
The specific label attribute of multiple labels described in the basic framework for the webpage that one execution module is opened, and show setting specific label
Webpage after attribute.
Optionally, the receiving module, is used for:
Receive the web page code for including attribute scripted code that server is sent;
Or, the web page code that server is sent is received, corresponding category is obtained to the server according to the web page code
Property scripted code.
Optionally, second execution module, is used for:
Perform the first script sentence in the attribute scripted code that the receiving module receives;
First script sentence is used in the basic framework that first execution module is performed to the webpage opened
First tag attributes of multiple labels with the first tag name are set as identical preset attribute value.
Optionally, second execution module, is used for:
Perform the second script sentence in the attribute scripted code that the receiving module receives;
Second script sentence is used in the basic framework that first execution module is performed to the webpage opened
Second tag attributes of multiple labels with the second tag name are respectively set to multiple and different preset attribute values.
Optionally,
Second script sentence is additionally operable to:To there are multiple labels of the second tag name in the basic framework of the webpage
The second tag attributes be respectively set to preset value in preset group;Wherein, each preset value in the preset group point
Not Dui Ying in multiple labels with the second tag name each label the second tag attribute values.
According to the third aspect of the embodiment of the present disclosure, a kind of device for showing webpage is provided, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Receive web page code and the attribute scripted code that server is sent;
The web page code is performed, to open the basic framework of webpage;
Wherein, multiple labels are included in the webpage, the specific mark of the multiple label is not included in the web page code
Property value is signed, the attribute scripted code is used to set for the multiple labels for being not provided with specific label attribute in the web page code
Put the specific label attribute;
The attribute scripted code is performed, to set the specific label of multiple labels described in the basic framework of the webpage
Attribute, and show the webpage after setting specific label attribute.
The technical scheme provided by this disclosed embodiment can include the following benefits:
In the embodiment of the present disclosure, web page code and attribute scripted code that server is sent are received, performs web page code, with
The basic framework of webpage is opened, wherein, multiple labels are included in webpage, the specific mark of this multiple label is not included in web page code
Property value is signed, attribute scripted code is used for specific for this multiple label setting for being not provided with specific label attribute in web page code
Tag attributes perform attribute scripted code, to set the specific label attribute of the multiple labels of this in the basic framework of webpage, and show
Show the webpage after setting specific label attribute.Processing method in this way allows server end before web page code is transmitted
Remove a certain tag attributes of the identical multiple labels of tag name, the polishing in webpage is gone by attribute scripted code by end side
The tag attributes removed, in this way, it is possible to reduce data volume from server to terminal transmission, it is thus possible to reduce network resources waste.
It should be understood that above general description and following detailed description are only exemplary and explanatory, not
The disclosure can be limited.
Description of the drawings
Attached drawing herein is incorporated into specification and forms the part of this specification, shows the implementation for meeting the disclosure
Example, and for explaining the principle of the disclosure together with specification.In the accompanying drawings:
Fig. 1 is the flow chart according to a kind of method of display webpage shown in an exemplary embodiment;
Fig. 2 is the schematic diagram according to a kind of web page code shown in an exemplary embodiment;
Fig. 3 is the schematic diagram according to a kind of device of display webpage shown in an exemplary embodiment;
Fig. 4 is the structure diagram according to a kind of terminal shown in an exemplary embodiment.
Pass through above-mentioned attached drawing, it has been shown that the specific embodiment of the disclosure will be hereinafter described in more detail.These attached drawings
The range for limiting the disclosure by any mode and conceiving is not intended to word description, but is by reference to specific embodiment
Those skilled in the art illustrate the concept of the disclosure.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, example is illustrated in the accompanying drawings.Following description is related to
During attached drawing, unless otherwise indicated, the same numbers in different attached drawings represent the same or similar element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended
The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Embodiment one
The embodiment of the present disclosure provides a kind of method for showing webpage, as shown in Figure 1, the process flow of this method can wrap
Include the steps:
In a step 101, web page code and the attribute scripted code that server is sent are received.
In a step 102, web page code is performed, to open the basic framework of webpage.Wherein, multiple marks are included in webpage
It signs, the specific label property value of this multiple label is not included in web page code, attribute scripted code is used for as in web page code
It is not provided with multiple labels setting specific label attribute of specific label attribute.
In step 103, attribute scripted code is performed, to set the specific label of multiple labels in the basic framework of webpage
Attribute, and show the webpage after setting specific label attribute.
In the embodiment of the present disclosure, web page code and attribute scripted code that server is sent are received, performs web page code, with
The basic framework of webpage is opened, wherein, multiple labels are included in webpage, the specific mark of this multiple label is not included in web page code
Property value is signed, attribute scripted code is used for specific for this multiple label setting for being not provided with specific label attribute in web page code
Tag attributes perform attribute scripted code, to set the specific label attribute of the multiple labels of this in the basic framework of webpage, and show
Show the webpage after setting specific label attribute.Processing method in this way allows server end before web page code is transmitted
Remove a certain tag attributes of the identical multiple labels of tag name, the polishing in webpage is gone by attribute scripted code by end side
The tag attributes removed, in this way, it is possible to reduce data volume from server to terminal transmission, it is thus possible to reduce network resources waste.
Embodiment two
The embodiment of the present disclosure provides a kind of method for showing webpage, and the executive agent of this method can be to be equipped with browsing
Device and the terminal with network transmission function, which can be computer, mobile phone etc..
Below in conjunction with embodiment, process flow shown in FIG. 1 is described in detail, content can be as follows:
In a step 101, web page code and the attribute scripted code that server is sent are received.
Wherein, attribute scripted code is that browser can identify simultaneously execution script code, for the basic subrack for webpage
Frame tags attribute.Web page code can be the code for the basic framework for being used to open webpage, and the basic framework of webpage is the absence of
The webpages of some tag attributes.This web page code can be the web page code deleted after predetermined symbol, and predetermined symbol can be
Newline, tab, space etc. do not influence the symbol of webpage content display.
In force, the server of website can compress the original web page code of webpage, can be in original web page
In code, multiple labels with same tag attributes are determined, for example, as shown in Fig. 2, multiple labels all have target (mesh
Mark) attribute.Then, the identical tag attributes are deleted in this multiple label, and identical tag name is set for these labels,
For example, as shown in Fig. 2, delete label in target=" _ blank ", the tag name of these labels is both configured to a.This phase
With property value of the tag attributes in multiple labels can be identical, such as the target attributes in Fig. 2, can also be different, such as Fig. 2
In herf attributes.Furthermore it is possible to attribute scripted code is generated, wherein comprising script sentence (can be referred to as attribute addition sentence),
For being that the tag attributes of above-mentioned deletion add property value in above-mentioned multiple labels, which is the attribute of above-mentioned deletion
Value, for example, the script sentence can be:$(‘a’).attr(‘target’,‘_blank’).If delete a variety of label categories
Property, then each tag attributes is corresponded to, an attribute addition sentence can be set.
The process of above-mentioned compressed webpage code can also be carried out by technical staff during web page code is write, can
Directly to save above-mentioned identical tag attributes in web page code, and identical tag name is set for corresponding label, simultaneously
Corresponding script sentence is set in attribute scripted code.Attribute scripted code can be mutual indepedent with web page code, and is taking
It is engaged in corresponding to storage in device, alternatively, attribute scripted code can also be a part for web page code.
When user wants to browse some webpage, can click the link of the webpage or in the address field of browser it is defeated
Enter the network address of the webpage and click to determine, terminal then can send web-page requests to corresponding server, and server is receiving net
After page request, the web page code of the webpage and attribute scripted code can be sent to terminal.Transmit web page code and attribute script
The mode of code can be varied, correspondingly, several feasible processing modes following present step 101:
Mode one receives the web page code for including attribute scripted code that server is sent.
In force, attribute scripted code can be arranged in corresponding web page code, server will include attribute
The web page code of scripted code is sent to terminal, and terminal can first carry out attribute therein during web page code is performed
Scripted code is that the basic framework of webpage adds corresponding tag attributes.
Mode two receives the web page code that server is sent, and corresponding attribute foot is obtained to server according to web page code
This code.
In force, corresponding sentence can be provided in web page code, for obtaining corresponding attribute foot to server
This code.Terminal can perform web page code after web page code is received, when going to the sentence, then can trigger to
Server sends script request, to obtain the corresponding attribute scripted code of the web page code.
In a step 102, web page code is performed, to open the basic framework of webpage.
Wherein, multiple labels are included in webpage, the specific label property value of this multiple label is not included in web page code, is belonged to
Property scripted code be used to set specific label attribute for the multiple labels for being not provided with specific label attribute in web page code.
In force, terminal can perform web page code after web page code is received, to carry out the display of webpage
Journey, can show the basic framework of webpage by the web page code, and not complete webpage, in the basic framework of the webpage,
Lack the specific label attribute of certain labels.
In step 103, attribute scripted code is performed, to set the specific label of multiple labels in the basic framework of webpage
Attribute, and show the webpage after setting specific label attribute.
In force, terminal can perform attribute foot during the basic framework for performing web page code opening webpage
Attribute addition sentence in this code, tag attributes are set for the label of the same name in the basic framework of webpage.Attribute scripted code
In can include one or more attributes and add sentences, $ (' a ') .attr as escribed above (' target ', ' _ blank ') belongs to
Property addition sentence can call DOM (Document Object Model, DOM Document Object Model) API of browser
(Application Programming Interface, application programming interfaces) interface is of the same name in the basic framework of webpage
Label sets tag attributes.Each attribute addition sentence can mark some of a kind of label (label of i.e. same tag name)
The property value of label attribute is set as the property value specified, and could be provided as same alike result value, may be set to be different attribute value.
By the setting of tag attributes in the basic framework to webpage, can be supplied on the basis of the basic framework of webpage, with
Show complete webpage.
Optionally, attribute scripted code sets the mode of tag attributes can be a variety of for the label in the basic framework of webpage
Various and different mode can be applied in combination, and following present several feasible processing modes:
Mode one, performs the first script sentence in attribute scripted code, and the first script sentence is used for the basic of webpage
The first tag attributes of multiple labels with the first tag name are set as identical preset attribute value in frame.
Wherein, the first tag name can be arbitrary tag name.First tag attributes can be arbitrary tag attributes.
In force, in server side, if in web page code multiple labels some tag attributes (i.e. above-mentioned first
Tag attributes, such as target attributes) property value it is identical, then can the first tag name be set for multiple labels thus.Then by this
The tag attributes in a little labels are deleted, for example, in web page code as shown in Figure 2, can delete multiple labels
Target attributes.The first script sentence is set in attribute scripted code simultaneously, the first script sentence can be by the basic of webpage
The first tag attributes of multiple labels with the first tag name are set as identical preset attribute value, the preset attribute in frame
It is worth the property value for above-mentioned deletion, which adds sentence for attribute.For example, in web page code shown in Fig. 2
Target attributes are deleted, corresponding first script sentence can be (' a ') .attr (' target ', ' _ blank '), Ji Jiangbiao
It signs and is set as _ blank for the property value of the target attributes of the label of a.
In end side, the first script sentence is performed, then the tag attributes of above-mentioned deletion can be added to the basic of webpage
In the respective labels of frame.The setting of the tag attributes of label of the same name is completed using such one section simple script sentence, it can be with
Remove a large amount of duplicated code from.
Optionally, in attribute scripted code, property value can be carried with a variable, correspondingly, the first script sentence
In property value can then be substituted for the variable, for example, Var b=' _ blank ', corresponding script sentence can also become $
(‘a’).attr(‘target’,b)。
Mode two, performs the second script sentence in attribute scripted code, and the second script sentence is used for the basic of webpage
The second tag attributes of multiple labels with the second tag name are respectively set to multiple and different preset attribute values in frame.
Wherein, the second tag name can be arbitrary tag name.Second tag attributes can be arbitrary tag attributes.
In force, in server side, if multiple labels are all (i.e. above-mentioned with same tag attributes in web page code
Second tag attributes, such as href attributes), then the tag name of this multiple label can be set as the second tag name.Then by this
The tag attributes in a little labels are deleted, for example, in web page code as shown in Figure 2, can delete the href of multiple labels
Attribute.The second script sentence is set in attribute scripted code simultaneously, the second script sentence can will be in the basic framework of webpage
Second tag attributes of multiple labels with the second tag name are respectively set to multiple preset attribute values, which is
The property value of above-mentioned deletion, multiple preset attribute values can be the same or different, which adds language for attribute
Sentence.
In end side, the second script sentence is performed, then the tag attributes of above-mentioned deletion can be added to the basic of webpage
In the respective labels of frame.The setting of the tag attributes of label of the same name is completed using such one section simple script sentence, it can be with
Remove a large amount of duplicated code from.
Optionally, the tag attributes setting up procedure in mode two can be completed by array, and corresponding processing procedure can be with
It is:Second script sentence is additionally operable to the second tag attributes of multiple labels with the second tag name in the basic framework by webpage
The preset value being respectively set in preset group;Wherein, each preset value in preset group is corresponding respectively has the second label
Second tag attribute values of each label in multiple labels of name.
In force, in server side, the second of above-mentioned deletion can be obtained by sequence vertical in web page code
The property value of tag attributes sets array assignment statement in attribute scripted code before the second script sentence, by the category of acquisition
Property value is assigned a value of each element (i.e. above-mentioned preset value) in array (i.e. above-mentioned preset group) in order, for example, shown in Fig. 2
In web page code, href attributes are deleted, sentence Var h=[http can be set in attribute scripted code accordingly://
www.qq.com,http://news.qq.com,http://sports.qq.com,http://ent.qq.com,http://
v.qq.com,http://finance.qq.com,http://finance.qq.com/stock/,http://
auto.qq.com,http://house.qq.com,http://tech.qq.com,http://digi.qq.com,http://
games.qq.com,http://edu.qq.com,http://fashion.qq.com/,http://cul.qq.com], to build
Vertical array h, corresponding second script sentence can be (' a ') .attr (' href ', h), i.e., by web page code from front to back
Sequence, the property value of the href attributes for the label that tag name in the basic framework of webpage is a is set as each member in array h
Element value.
In the embodiment of the present disclosure, web page code and attribute scripted code that server is sent are received, performs web page code, with
The basic framework of webpage is opened, wherein, multiple labels are included in webpage, the specific mark of this multiple label is not included in web page code
Property value is signed, attribute scripted code is used for specific for this multiple label setting for being not provided with specific label attribute in web page code
Tag attributes perform attribute scripted code, to set the specific label attribute of the multiple labels of this in the basic framework of webpage, and show
Show the webpage after setting specific label attribute.Processing method in this way allows server end before web page code is transmitted
Remove a certain tag attributes of the identical multiple labels of tag name, the polishing in webpage is gone by attribute scripted code by end side
The tag attributes removed, in this way, it is possible to reduce data volume from server to terminal transmission, it is thus possible to reduce network resources waste.
Embodiment three
Based on identical technical concept, the embodiment of the present disclosure additionally provides a kind of device for showing webpage, as shown in figure 3,
The device includes:Receiving module 310, the first execution module 320 and the second execution module 330.
Receiving module 310 is configured as receiving web page code and the attribute scripted code that server is sent;
First execution module 320 is configured as performing the web page code that the receiving module receives, to open webpage
Basic framework;
Wherein, multiple labels are included in the webpage, the specific mark of the multiple label is not included in the web page code
Property value is signed, the attribute scripted code is used to set for the multiple labels for being not provided with specific label attribute in the web page code
Put the specific label attribute;
Second execution module 330 is configured as performing the attribute scripted code that the receiving module receives, with setting
The specific label attribute of multiple labels described in the basic framework for the webpage that first execution module is opened, and show that setting is special
Determine the webpage after tag attributes.
Optionally, the receiving module 310, is configured as:
Receive the web page code for including attribute scripted code that server is sent;
Or, the web page code that server is sent is received, corresponding category is obtained to the server according to the web page code
Property scripted code.
Optionally, second execution module 330, is configured as:
Perform the first script sentence in the attribute scripted code that the receiving module receives;
First script sentence is used in the basic framework that first execution module is performed to the webpage opened
First tag attributes of multiple labels with the first tag name are set as identical preset attribute value.
Optionally, second execution module 330, is configured as:
Perform the second script sentence in the attribute scripted code that the receiving module receives;
Second script sentence is used in the basic framework that first execution module is performed to the webpage opened
Second tag attributes of multiple labels with the second tag name are respectively set to multiple and different preset attribute values.
Optionally,
Second script sentence is additionally operable to:To there are multiple labels of the second tag name in the basic framework of the webpage
The second tag attributes be respectively set to preset value in preset group;Wherein, each preset value in the preset group point
Not Dui Ying in multiple labels with the second tag name each label the second tag attribute values.
In the embodiment of the present disclosure, web page code and attribute scripted code that server is sent are received, performs web page code, with
The basic framework of webpage is opened, wherein, multiple labels are included in webpage, the specific mark of this multiple label is not included in web page code
Property value is signed, attribute scripted code is used for specific for this multiple label setting for being not provided with specific label attribute in web page code
Tag attributes perform attribute scripted code, to set the specific label attribute of the multiple labels of this in the basic framework of webpage, and show
Show the webpage after setting specific label attribute.Processing method in this way allows server end before web page code is transmitted
Remove a certain tag attributes of the identical multiple labels of tag name, the polishing in webpage is gone by attribute scripted code by end side
The tag attributes removed, in this way, it is possible to reduce data volume from server to terminal transmission, it is thus possible to reduce network resources waste.
It should be noted that:The device of display webpage that above-described embodiment provides is when showing webpage, only with above-mentioned each work(
Can module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different functions
Module is completed, i.e., the internal structure of device is divided into different function modules, described above all or part of to complete
Function.In addition, the device for the display webpage that above-described embodiment provides and the embodiment of the method for display webpage belong to same design,
Specific implementation process refers to embodiment of the method, and which is not described herein again.
Example IV
Fig. 4 is the structure diagram according to a kind of terminal shown in an exemplary embodiment.The terminal can be computer,
Mobile phone etc..
With reference to Fig. 4, audio output apparatus 400 can include following one or more components:Processing component 402, memory
404, power supply module 406, multimedia component 408, audio component 410, the interface 412 of input/output (I/O), sensor module
414 and communication component 416.
Processing component 402 usually control audio output apparatus 400 integrated operation, such as with display, call, data
Communication, camera operation and record operate associated operation.Processing element 402 can be including one or more processors 420
Execute instruction, to perform all or part of the steps of the methods described above.In addition, processing component 402 can include one or more
Module, convenient for the interaction between processing component 402 and other assemblies.For example, processing component 402 can include multi-media module,
To facilitate the interaction between multimedia component 408 and processing component 402.
Memory 404 is configured as storing various types of data to support the operation in audio output apparatus 400.These
The example of data includes the instruction of any application program or method for being operated on audio output apparatus 400, contacts number
According to, telephone book data, message, picture, video etc..Memory 404 can be by any kind of volatibility or non-volatile memories
Equipment or combination thereof are realized, such as static RAM (SRAM), electrically erasable programmable read-only memory
(EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only memory
(ROM), magnetic memory, flash memory, disk or CD.
Electric power assembly 406 provides electric power for the various assemblies of audio output apparatus 400.Electric power assembly 406 can include electricity
Management system, one or more power supplys and other generate, manage and to distribute electric power associated with for audio output apparatus 400
Component.
Multimedia component 408 is included in one output interface of offer between the audio output apparatus 400 and user
Screen.In some embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touching
Panel is touched, screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more
Touch sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or
The boundary of sliding action, but also detect duration and pressure associated with the touch or slide operation.In some implementations
In example, multimedia component 408 includes a front camera and/or rear camera.When audio output apparatus 400 is in operation
Pattern, during such as screening-mode or video mode, front camera and/or rear camera can receive external multimedia number
According to.Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom
Ability.
Audio component 410 is configured as output and/or input audio signal.For example, audio component 410 includes a Mike
Wind (MIC), when audio output apparatus 400 is in operation mode, during such as call model, logging mode and speech recognition mode, wheat
Gram wind is configured as receiving external audio signal.The received audio signal can be further stored in memory 404 or warp
It is sent by communication component 416.In some embodiments, audio component 410 further includes a loud speaker, for exporting audio letter
Number.
I/O interfaces 412 provide interface between processing component 402 and peripheral interface module, and above-mentioned peripheral interface module can
To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock
Determine button.
Sensor module 414 includes one or more sensors, for providing various aspects for audio output apparatus 400
Status assessment.For example, sensor module 414 can detect opening/closed state of audio output apparatus 400, the phase of component
To positioning, such as the display and keypad that the component is audio output apparatus 400, sensor module 414 can also detect
The position change of 400 1 components of audio output apparatus 400 or audio output apparatus, user contact with audio output apparatus 400
Existence or non-existence, 400 orientation of audio output apparatus or acceleration/deceleration and the temperature change of audio output apparatus 400.Sensing
Device assembly 414 can include proximity sensor, be configured to detect depositing for neighbouring object without any physical contact
.Sensor module 414 can also include optical sensor, such as CMOS or ccd image sensor, for making in imaging applications
With.In some embodiments, which can also include acceleration transducer, gyro sensor, magnetic sensing
Device, pressure sensor or temperature sensor.
Communication component 416 is configured to facilitate wired or wireless way between audio output apparatus 400 and other equipment
Communication.Audio output apparatus 400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their group
It closes.In one exemplary embodiment, communication component 416 receives the broadcast from external broadcasting management system via broadcast channel
Signal or broadcast related information.In one exemplary embodiment, the communication component 416 further includes near-field communication (NFC) mould
Block, to promote short range communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) skill can be based in NFC module
Art, ultra wide band (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, audio output apparatus 400 can be by one or more application application-specific integrated circuit
(ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), scene can
It programs gate array (FPGA), controller, microcontroller, microprocessor or other electronic components to realize, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided
Such as include the memory 404 of instruction, above-metioned instruction can be performed to complete above-mentioned side by the processor 420 of audio output apparatus 400
Method.For example, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic
Band, floppy disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is held by the processor of terminal
During row so that terminal is able to carry out a kind of method for showing webpage, and this method includes:
Receive web page code and the attribute scripted code that server is sent;
The web page code is performed, to open the basic framework of webpage;
Wherein, multiple labels are included in the webpage, the specific mark of the multiple label is not included in the web page code
Property value is signed, the attribute scripted code is used to set for the multiple labels for being not provided with specific label attribute in the web page code
Put the specific label attribute;
The attribute scripted code is performed, to set the specific label of multiple labels described in the basic framework of the webpage
Attribute, and show the webpage after setting specific label attribute.
Optionally, it is described to receive web page code and the attribute scripted code that server is sent, including:
Receive the web page code for including attribute scripted code that server is sent;
Or, the web page code that server is sent is received, corresponding category is obtained to the server according to the web page code
Property scripted code.
Optionally, it is described to perform the attribute scripted code, to set multiple marks described in the basic framework of the webpage
The specific label attribute of label, including:
Perform the first script sentence in the attribute scripted code;
First script sentence is used for the multiple labels that will have the first tag name in the basic framework of the webpage
First tag attributes are set as identical preset attribute value.
Optionally, it is described to perform the attribute scripted code, to set multiple marks described in the basic framework of the webpage
The specific label attribute of label, including:
Perform the second script sentence in the attribute scripted code;
Second script sentence is used for the multiple labels that will have the second tag name in the basic framework of the webpage
Second tag attributes are respectively set to multiple and different preset attribute values.
Optionally,
Second script sentence is additionally operable to:To there are multiple labels of the second tag name in the basic framework of the webpage
The second tag attributes be respectively set to preset value in preset group;Wherein, each preset value in the preset group point
Not Dui Ying in multiple labels with the second tag name each label the second tag attribute values.
In the embodiment of the present disclosure, web page code and attribute scripted code that server is sent are received, performs web page code, with
The basic framework of webpage is opened, wherein, multiple labels are included in webpage, the specific mark of this multiple label is not included in web page code
Property value is signed, attribute scripted code is used for specific for this multiple label setting for being not provided with specific label attribute in web page code
Tag attributes perform attribute scripted code, to set the specific label attribute of the multiple labels of this in the basic framework of webpage, and show
Show the webpage after setting specific label attribute.Processing method in this way allows server end before web page code is transmitted
Remove a certain tag attributes of the identical multiple labels of tag name, the polishing in webpage is gone by attribute scripted code by end side
The tag attributes removed, in this way, it is possible to reduce data volume from server to terminal transmission, it is thus possible to reduce network resources waste.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice disclosure disclosed herein
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or
Person's adaptive change follows the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure
Or conventional techniques.Description and embodiments are considered only as illustratively, and the true scope and spirit of the disclosure are by following
Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by appended claim.
Claims (9)
- A kind of 1. method for showing webpage, which is characterized in that the method includes:Receive web page code and the attribute scripted code that server is sent;The web page code is performed, to open the basic framework of webpage;Wherein, multiple labels are included in the webpage, the specific label category of the multiple label is not included in the web page code Property value, the attribute scripted code be used for in the web page code be not provided with specific label attribute multiple labels setting institute State specific label attribute;The attribute scripted code is performed, to set the specific label category of multiple labels described in the basic framework of the webpage Property, and show the webpage after setting specific label attribute;It is described to perform the attribute scripted code, to set the specific label of multiple labels described in the basic framework of the webpage Attribute, including:Perform the first script sentence in the attribute scripted code;First script sentence is used for first of multiple labels in the basic framework of the webpage with the first tag name Tag attributes are set as identical preset attribute value.
- 2. according to the method described in claim 1, it is characterized in that, described receive web page code and the attribute foot that server is sent This code, including:Receive the web page code for including attribute scripted code that server is sent;Or, the web page code that server is sent is received, corresponding attribute foot is obtained to the server according to the web page code This code.
- 3. according to the method described in claim 1, it is characterized in that, described perform the attribute scripted code, with described in setting The specific label attribute of multiple labels described in the basic framework of webpage, including:Perform the second script sentence in the attribute scripted code;Second script sentence is used for second of multiple labels in the basic framework of the webpage with the second tag name Tag attributes are respectively set to multiple and different preset attribute values.
- 4. according to the method described in claim 3, it is characterized in that,Second script sentence is additionally operable to:To there is the second tag name in the basic framework of the webpage the of multiple labels Two tag attributes are respectively set to the preset value in preset group;Wherein, each preset value in the preset group is right respectively Answer the second tag attribute values of each label in multiple labels with the second tag name.
- 5. a kind of device for showing webpage, which is characterized in that described device includes:Receiving module, for receiving the web page code and attribute scripted code of server transmission;First execution module, for performing the web page code that the receiving module receives, to open the basic framework of webpage;Wherein, multiple labels are included in the webpage, the specific label category of the multiple label is not included in the web page code Property value, the attribute scripted code be used for in the web page code be not provided with specific label attribute multiple labels setting institute State specific label attribute;Second execution module, for performing the attribute scripted code that the receiving module receives, to set described first to hold The specific label attribute of multiple labels described in the basic framework for the webpage that row module is opened, and show setting specific label attribute Webpage afterwards;Second execution module, is used for:Perform the first script sentence in the attribute scripted code that the receiving module receives;First script sentence, which is used to perform first execution module in the basic framework for the webpage opened, to be had First tag attributes of multiple labels of the first tag name are set as identical preset attribute value.
- 6. device according to claim 5, which is characterized in that the receiving module is used for:Receive the web page code for including attribute scripted code that server is sent;Or, the web page code that server is sent is received, corresponding attribute foot is obtained to the server according to the web page code This code.
- 7. device according to claim 5, which is characterized in that second execution module is used for:Perform the second script sentence in the attribute scripted code that the receiving module receives;Second script sentence, which is used to perform first execution module in the basic framework for the webpage opened, to be had Second tag attributes of multiple labels of the second tag name are respectively set to multiple and different preset attribute values.
- 8. device according to claim 7, which is characterized in thatSecond script sentence is additionally operable to:To there is the second tag name in the basic framework of the webpage the of multiple labels Two tag attributes are respectively set to the preset value in preset group;Wherein, each preset value in the preset group is right respectively Answer the second tag attribute values of each label in multiple labels with the second tag name.
- 9. a kind of terminal, which is characterized in that including:Processor;For storing the memory of processor-executable instruction;Wherein, the processor is configured as:Receive web page code and the attribute scripted code that server is sent;The web page code is performed, to open the basic framework of webpage;Wherein, multiple labels are included in the webpage, the specific label category of the multiple label is not included in the web page code Property value, the attribute scripted code be used for in the web page code be not provided with specific label attribute multiple labels setting institute State specific label attribute;The attribute scripted code is performed, to set the specific label category of multiple labels described in the basic framework of the webpage Property, and show the webpage after setting specific label attribute;It is described to perform the attribute scripted code, to set the specific label of multiple labels described in the basic framework of the webpage Attribute, including:Perform the first script sentence in the attribute scripted code;First script sentence is used for first of multiple labels in the basic framework of the webpage with the first tag name Tag attributes are set as identical preset attribute value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410373296.1A CN104239407B (en) | 2014-07-31 | 2014-07-31 | A kind of method and apparatus for showing webpage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410373296.1A CN104239407B (en) | 2014-07-31 | 2014-07-31 | A kind of method and apparatus for showing webpage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104239407A CN104239407A (en) | 2014-12-24 |
CN104239407B true CN104239407B (en) | 2018-06-08 |
Family
ID=52227469
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410373296.1A Active CN104239407B (en) | 2014-07-31 | 2014-07-31 | A kind of method and apparatus for showing webpage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104239407B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104750793A (en) * | 2015-03-12 | 2015-07-01 | 小米科技有限责任公司 | Method and device for generating page tables |
CN108153663B (en) * | 2016-12-02 | 2022-02-18 | 阿里巴巴集团控股有限公司 | Page data processing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101639853A (en) * | 2009-08-26 | 2010-02-03 | 王建军 | Text display method used for household electrical appliance terminal |
CN101706821A (en) * | 2009-12-10 | 2010-05-12 | 中兴通讯股份有限公司 | Tag-based mobile internet page design system and method |
CN103279541A (en) * | 2013-06-04 | 2013-09-04 | 天津市天安怡和信息技术有限公司 | Method and device for reducing web browser load |
-
2014
- 2014-07-31 CN CN201410373296.1A patent/CN104239407B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101639853A (en) * | 2009-08-26 | 2010-02-03 | 王建军 | Text display method used for household electrical appliance terminal |
CN101706821A (en) * | 2009-12-10 | 2010-05-12 | 中兴通讯股份有限公司 | Tag-based mobile internet page design system and method |
CN103279541A (en) * | 2013-06-04 | 2013-09-04 | 天津市天安怡和信息技术有限公司 | Method and device for reducing web browser load |
Also Published As
Publication number | Publication date |
---|---|
CN104239407A (en) | 2014-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103914523A (en) | Page rollback controlling method and page rollback controlling device | |
CN103870551B (en) | The method and apparatus that a kind of cross-domain data obtains | |
CN103886025A (en) | Method and device for displaying pictures in webpage | |
CN103914502A (en) | Method for intelligent search service using situation recognition and terminal thereof | |
CN104636164B (en) | Start page generation method and device | |
WO2017156983A1 (en) | List callup method and device | |
CN106897937A (en) | A kind of method and apparatus for showing social sharing information | |
CN106126632A (en) | Recommend method and device | |
CN106843740A (en) | Mobile terminal and mobile terminal touch control input method | |
CN106843642A (en) | The exchange method and mobile terminal of a kind of mobile terminal | |
CN104063424B (en) | Web page picture shows method and demonstration device | |
JP7187491B2 (en) | Information display method, device and medium | |
CN110020361A (en) | A kind of web page processing method, device, storage medium and electronic equipment | |
CN104239407B (en) | A kind of method and apparatus for showing webpage | |
CN104111829A (en) | Data storage method and device | |
CN113849092A (en) | Content sharing method and device and electronic equipment | |
CN105468606A (en) | Webpage saving method and device | |
CN111857466A (en) | Message display method and device | |
CN105630948A (en) | Web page display method and apparatus | |
CN107885571B (en) | Display page control method and device | |
CN105930034A (en) | Dialog box display method and apparatus | |
CN107168969A (en) | A kind of page elements control method, device and electronic equipment | |
CN105955637A (en) | Method and apparatus for processing a text input box | |
CN112882624B (en) | Process management method and device, electronic equipment and storage medium | |
CN105653058B (en) | The creation of input method dictionary and loading method, device, terminal and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |