CN109408762A - A kind of method and device of the carrying advertisement in the page - Google Patents
A kind of method and device of the carrying advertisement in the page Download PDFInfo
- Publication number
- CN109408762A CN109408762A CN201811237038.5A CN201811237038A CN109408762A CN 109408762 A CN109408762 A CN 109408762A CN 201811237038 A CN201811237038 A CN 201811237038A CN 109408762 A CN109408762 A CN 109408762A
- Authority
- CN
- China
- Prior art keywords
- advertisement
- label
- html
- page
- iframe
- 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
Links
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention implements a kind of method and device of carrying advertisement in the page.Wherein, it is previously provided with advertisement position label in the HTML code of the page of advertisement to be loaded, and quotes the file destination write based on primary JavaScript code in the page.When loading page, the code in file destination is performed, so as to realize from server-side acquisition audience and be loaded into the advertisement position label of the page.It is write since the file destination of page reference is based on primary JavaScript code, therefore method and attribute packaged by load front end frame are not needed when loading page, so as to improve the efficiency of page carrying advertisement, and, the case where avoiding the call error being easy to appear using the page of multiple front end frames in carrying advertisement is reduced code and runs the probability to report an error.
Description
Technical field
The present invention relates to software technology fields, more particularly to a kind of method and device of carrying advertisement in the page.
Background technique
Usually show there is advertisement in the page that browser or client-side program are loaded, to realize that this is wide by the network promotion
Accuse the purpose of corresponding commodity.In order to realize the carrying advertisement in the page, in the prior art, being added in the code of the page has
Advertisement loads the code of function, this, which has the code of advertisement load function, is developed based on front end frame corresponding to the page;
In turn, when the page loads, the code with advertisement load function is executed, to obtain advertisement from the corresponding server-side of the page,
The carrying advertisement after getting advertisement.
Since the code of advertisement load function is developed based on front end frame corresponding to the page, in the page
It when carrying advertisement, needs first to load the code of method packaged by the front end frame and attribute, then could load specific wide
Content is accused, so as to cause the inefficiency of the carrying advertisement in the page.
Summary of the invention
The method and device for being designed to provide a kind of carrying advertisement in the page of the embodiment of the present invention, to improve in page
The efficiency of carrying advertisement in face.Specific technical solution is as follows:
In a first aspect, the method for the embodiment of the invention provides a kind of in page carrying advertisement, wherein advertisement to be loaded
The page in quote the file destination write based on primary JavaScript code, be provided in the HTML code of the page wide
Position label is accused, is provided with advertisement id in the advertisement position label, the advertisement position label is the predetermined HTML for advertisement position occupation
Label;
When the page is loaded, the primary JavaScript code in the file destination is performed, and is realized in page
The method of carrying advertisement in face, which comprises
Detect the advertisement position label in the HTML code of the page;
The advertisement id is obtained from detected advertisement position label;
The corresponding target data of the advertisement id is obtained from server-side;The corresponding target data of the advertisement id includes described
The corresponding chained address advertisement id;
The corresponding audience of the advertisement id is obtained from the chained address;
In the advertisement position label, the corresponding audience of the advertisement id is loaded.
Optionally, the advertisement position label, comprising:
HTML<ins>label, HTML<del>label, HTML<tag>label, HTML<data>label or HTML<temp>
Label.
Optionally, in the advertisement position label, the corresponding audience of the advertisement id is loaded, comprising:
In the advertisement position label, HTML<iframe>label is created;
The corresponding audience of the advertisement id is added in the HTML<iframe>label.
Optionally, the corresponding target data of the advertisement id further include: the corresponding setting parameter of the advertisement id, it is described to set
Setting parameter is the parameter for the HTML<iframe>label to be arranged;
It is described that the corresponding audience of advertisement id is added in the HTML<iframe>label, comprising:
According to the setting parameter, the HTML<iframe>label is set;
After HTML<iframe>label is set, the corresponding audience of the advertisement id is added to described
In HTML<iframe>label.
Optionally, the method also includes:
When getting the chained address and the setting parameter, by the chained address and the setting parameter with two
The form of dimension group is saved;
It is described that the corresponding audience of the advertisement id is obtained from chained address, comprising:
The chained address is read from the two-dimensional array, request obtains id pairs of the advertisement from the chained address
The audience answered;
It is described according to the setting parameter, the HTML<iframe>label is set, comprising:
The setting parameter is read from the two-dimensional array, and according to the setting parameter, the HTML < iframe is set
> label.
Second aspect, the device of the embodiment of the invention provides a kind of in page carrying advertisement, wherein advertisement to be loaded
The page in quote the file destination write based on primary JavaScript code, be provided in the HTML code of the page wide
Position label is accused, is provided with advertisement id in the advertisement position label, the advertisement position label is the predetermined HTML for advertisement position occupation
Label;
When the page is loaded, the primary JavaScript code in the file destination is performed, and is realized in page
The corresponding processing function of the device of carrying advertisement, described device include: in face
Label detecting unit, the advertisement position label in the HTML code for detecting the page;
Advertisement id acquiring unit, for obtaining the advertisement id from detected advertisement position label;
Target data acquiring unit, for obtaining the corresponding target data of the advertisement id from server-side;The advertisement id
Corresponding target data includes the corresponding chained address the advertisement id;
Audience acquiring unit, for obtaining the corresponding audience of the advertisement id from the chained address;
Audience loading unit, for loading the corresponding audience of the advertisement id in the advertisement position label.
Optionally, the advertisement position label, comprising:
HTML<ins>label, HTML<del>label, HTML<tag>label, HTML<data>label or HTML<temp>
Label.
Optionally, the audience loading unit, comprising:
Label creates subelement, for creating HTML<iframe>label in the advertisement position label;
Object adds subelement, for the corresponding audience of the advertisement id to be added to the HTML<iframe>mark
In label.
Optionally, the corresponding target data of the advertisement id further include: the corresponding setting parameter of the advertisement id, it is described to set
Setting parameter is the parameter for the HTML<iframe>label to be arranged;
The object adds subelement, is specifically used for:
According to the setting parameter, the HTML<iframe>label is set;
After HTML<iframe>label is set, the corresponding audience of the advertisement id is added to described
In HTML<iframe>label.
Optionally, described device further include: storage unit;The storage unit, for getting the chained address
When with the setting parameter, the chained address and the setting parameter are saved in the form of two-dimensional array;
The audience acquiring unit, is specifically used for: the chained address is read from the two-dimensional array, from described
Request obtains the corresponding audience of the advertisement id in chained address;
The object adds subelement, is specifically used for:
The setting parameter is read from the two-dimensional array, and according to the setting parameter, the HTML < iframe is set
> label.
In the method for the carrying advertisement provided in an embodiment of the present invention in the page, the page reference of advertisement to be loaded is based on original
The file destination that raw JavaScript code is write.When loading page, the code in the file destination is performed, and is realized from service
End obtains audience and is loaded into the page.It is write since the file destination is based on primary JavaScript code, loading page
When do not need method and attribute packaged by load front end frame, therefore, provided by the embodiment of the present invention is loaded in the page
The method of advertisement improves the efficiency of the carrying advertisement in the page.Certainly, it implements any of the products of the present invention or method must be different
It is fixed to need while reaching all the above advantage.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of the method for the carrying advertisement in the page provided in an embodiment of the present invention;
Fig. 2 is a kind of structural schematic diagram of the device of the carrying advertisement in the page provided in an embodiment of the present invention;
Fig. 3 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In order to improve the efficiency of the carrying advertisement in the page, the embodiment of the invention provides one kind in page carrying advertisement
Method and apparatus.
Firstly, a kind of method in page carrying advertisement provided in an embodiment of the present invention is described in detail.
It should be noted that a kind of method in page carrying advertisement provided by the embodiment of the present invention can be adapted for electricity
In sub- equipment.In a particular application, which can be smart phone, tablet computer, laptop, desktop computer etc.
Equipment.In addition, the browser or client-side program in electronic equipment are the program for loading page, in browser or client
A kind of method of the carrying advertisement in the page provided by the embodiment of the present invention is realized during program loading page.
In order to solve prior art problem, in embodiments of the present invention, reference is based on primary in the page of advertisement to be loaded
The file destination that JavaScript code is write.Also, advertisement position label is previously provided in the HTML code of the page.Wherein,
Advertisement position label is the predetermined html tag for advertisement position occupation.In addition, being provided with advertisement id in advertisement position label.It needs to illustrate
Be.In practical applications, the developer of the page needs first to determine the quantity for needing to launch audience in the page and position, so
Afterwards, at the HTML code corresponding to the position for needing to launch audience, advertisement position label is added, to be reached for advertisement pair
Purpose as carrying out advertisement position occupy-place;In turn, advertisement position id and advertisement id is set for these advertisement position labels.
Wherein, advertisement position id can be used for distinguishing multiple advertisement positions in the page, and advertisement id can be used for distinguishing multiple
Audience.It is emphasized that the embodiment of the present invention is without limitation for the occurrence of advertisement position id and advertisement id.And it is wide
Accusing object can be the picture for showing ad content, and video, text etc., it is not limited in the embodiment of the present invention.
When the page of advertisement to be loaded is loaded, the primary JavaScript code in file destination is performed, real
The method of the existing carrying advertisement provided in an embodiment of the present invention in the page, as shown in Figure 1, method includes the following steps:
S101: the advertisement position label in the HTML code of advertisement page to be loaded is detected.
When primary JavaScript code is performed, the HTML code can be traversed first, to detect to be loaded wide
The advertisement position label in the HTML code of the page is accused, and then after detecting advertisement position label, executes subsequent S102.
S102: advertisement id is obtained from detected advertisement position label.
After detecting advertisement position label, it can be obtained from detected advertisement position label and be set in advance in the advertisement
Advertisement id in the label of position, and then subsequent S103 is executed using acquired advertisement id, to be obtained and advertisement id from server-side
Corresponding target data.
S103: target data corresponding with advertisement id is obtained from server-side.
After getting advertisement id, advertisement id can be sent into server-side, so that server-side is after receiving advertisement id,
It determines the corresponding target data of advertisement id, and feeds back to electronic equipment.Wherein, the corresponding target data of advertisement id may include
The corresponding chained address advertisement id.It is understood that server-side can be pre-established with each advertisement id and audience
The corresponding relationship of data content after getting advertisement id, can determine acquired advertisement id in turn based on the corresponding relationship
Corresponding target data.Wherein, the data content of each advertisement id may include chained address.
In this step, the chained address of audience is obtained to server-side, it can be by way of creation Ajax request
It realizes, i.e., sends to server-side and requested for the Ajax of request target data.Wherein, Ajax refers to asynchronous JavaScript and can expand
Open up mark language XML.
S104: the corresponding audience of advertisement id is obtained from chained address.S105: in advertisement position label, load is wide
Accuse the corresponding audience of id.
After getting chained address, the corresponding audience of advertisement id can be obtained from chained address, in advertisement position
In label, the corresponding audience of carrying advertisement id can make to show the audience for having load to complete in the page in this way.Show
Example property, in a kind of specific implementation, in advertisement position label, the corresponding audience of carrying advertisement id may include:
In the advertisement position label, HTML<iframe>label is created;
The corresponding audience of advertisement id is added in HTML<iframe>label.
In practical applications, HTML<iframe>label is usually used to is embedded in another text in current html document
Shelves.Using iframe carrying advertisement content, do not influenced by the pattern of the page itself, it will not be with the style conflict of the page itself.
It optionally, can be according to previously given about HTML<iframe>label after creating HTML<iframe>label
Setting parameter, HTML<iframe>label is arranged.Wherein, setting parameter may include: HTML<iframe>label
Width, it is high, it can also include the setting options of the dynamic operation of HTML<iframe>label.Here, dynamic operation is such as: load
Complete advertisement hides the advertisement after advertisement, click advertisement are automatically closed after 10 seconds or replaces other advertisements etc. after clicking advertisement.
In addition, in practical applications, it, can be each if in the HTML code of the page including multiple advertisement position labels
The carrying advertisement object in an advertisement position label, then repeats above-mentioned steps, until advertisement position labels whole in the page
Audience is all loaded.Certainly, this process is cracking for a user, and what user was seen on the page can be
Multiple audiences are shown simultaneously.
It is understood that if there are multiple advertisement position labels in HTML code, in the first implementation, whenever
When getting an advertisement id, the corresponding target data of advertisement id can be requested to server-side.In another implementation,
All corresponding target datas of advertisement id can be requested simultaneously to server-side after getting all advertisement id.For
It, can be according to advertisement position id come into electronic equipment back page when server-side returns to chained address for two kinds of implementations
Advertisement position label corresponding to correct chained address.
Provided by the embodiment of the present invention in the page in the method for carrying advertisement, the page reference of advertisement to be loaded is based on
The file destination that primary JavaScript code is write.When loading page, the code in the file destination is performed, and is realized from clothes
Business end obtains audience and is loaded into the page.It writes, loads since the target this document is based on primary JavaScript code
Method and attribute packaged by load front end frame are not needed when the page, therefore, provided by the embodiment of the present invention in the page
The method of carrying advertisement improves the efficiency of page carrying advertisement.In addition, the page for using multiple front end frames, each
Front end frame respectively encapsulates the method and attribute of oneself, often has between multiple frames, the code encapsulated in method or attribute
Difference, but the identical situation of name of packaged method or attribute.In this way, page carrying advertisement calls these methods or attribute
When, it is easy to call error causes code operation to report an error.And the side of the provided carrying advertisement in the page of the embodiment of the present invention
In method, file destination cited in the page is based on primary JavaScript code and writes, and the page does not need load front end when loading
Method packaged by frame and attribute, so as to avoid the page using multiple front end frames from being easy to appear in carrying advertisement
Call error the case where.Therefore, the method for the provided carrying advertisement in the page of the embodiment of the present invention, also reduces code
Run the probability to report an error.
Optionally, advertisement position label can be using in HTML: HTML<ins>label, HTML<del>label, HTML<
Tag>label, HTML<data>label or HTML<temp>label.These labels belong to the special tag being of little use, and can be used to
Custom Attributes.Also, the standard web page HTML code for meeting specification is not in these above-mentioned html tags, therefore,
Use these labels as advertisement position label, can be distinguished with the label of other in page HTML code.It requires emphasis
It is that the specific tag types of above-mentioned given advertisement position label are merely exemplary, should constitute to of the invention real
Apply the restriction of example.
Optionally, in one implementation, can also to include: that advertisement id is corresponding set the corresponding target data of advertisement id
Parameter is set, which is the parameter for HTML<iframe>label to be arranged.
So, correspondingly, the corresponding audience of advertisement id is added to the step in the HTML<iframe>label,
May include:
According to setting parameter, HTML<iframe>label is set;
After HTML<iframe>label is set, by the corresponding audience of advertisement id, it is being added to HTML<iframe>
In label.
In practical applications, setting parameter may include the width of HTML<iframe>label, high, can also include HTML<
Iframe > label dynamic operation setting options.Here, dynamic operation is such as: be automatically closed after having loaded advertisement 10 seconds advertisement,
The advertisement is hidden after clicking advertisement or replaces other advertisements etc. after clicking advertisement.In addition, dynamic operation can be in HTML < iframe
It is configured on > label.Here it is possible to for HTML<iframe>label be arranged iframe label id come distinguish multiple HTML<
Iframe > label.In addition it is also possible to play the role of distinguishing with the advertisement position id of advertisement position label.
It optionally, in one implementation, can also be by audience when getting chained address and setting parameter
Chained address and setting parameter saved in the form of two-dimensional array.
Correspondingly, obtaining the corresponding audience of advertisement id from chained address, comprising: read link from two-dimensional array
Address, request obtains the corresponding audience of advertisement id from chained address.
And according to setting parameter, HTML<iframe>label is set, comprising: the setting is read from two-dimensional array
HTML<iframe>label is arranged according to setting parameter in parameter.
In this way, obtain chained address and setting parameter be all locally operated, can to avoid with server-side continually
It interacts, saves Internet resources.
It further optionally, can be in the finally reference of the HTML code of the advertisement page to be loaded file destination.It is corresponding
, when loading page, all HTML elements of the page can just load the file destination after all having loaded.In this way, if adding
Mistake occurs when carrying the file destination leads to file destination load failure, and it is normal will not to influence other labels on the page
Load.
Embodiment content in summary it is found that provided by the embodiment of the present invention in the page carrying advertisement method
In, the page of advertisement to be loaded quotes the file destination write based on primary JavaScript code.When loading page, the target
Code in file is performed, and is realized and is obtained audience from server-side and be loaded into the page.Since the target this document is based on
Primary JavaScript code is write, and when loading page does not need method and attribute packaged by load front end frame, therefore, this
The method of the provided carrying advertisement in the page of inventive embodiments, improves the efficiency of page carrying advertisement, also, avoid
The case where call error being easy to appear using the page of multiple front end frames in carrying advertisement, is reduced code operation and reported an error
Probability.In addition, in the method for carrying advertisement, using the html tag being of little use in the page provided by the embodiment of the present invention
As advertisement position label, distinguished with other common labels in page HTML code.Also, it is marked using HTML<iframe>
Carrying advertisement content is signed, is not influenced by the pattern of the page itself, it will not be with the style conflict of the page itself.
Further, since the browser of different kernels, the code standard of identification are different.Therefore, different clear in order to be compatible with
Look at device, and the compatibility made on the basis of the method for carrying advertisement in the page provided by the embodiment of the present invention is adjusted
It is whole, belong to protection scope of the present invention.
Corresponding to above-mentioned embodiment of the method, the dress of the embodiment of the invention also provides a kind of in page carrying advertisement
It sets.It should be noted that a kind of device in page carrying advertisement provided by the embodiment of the present invention can be adapted for electronics and set
In standby.In a particular application, which can set for smart phone, tablet computer, laptop, desktop computer etc.
It is standby.In addition, the browser or client-side program in electronic equipment are the program for loading page, in browser or client journey
A kind of corresponding place of device of the carrying advertisement in the page provided by the embodiment of the present invention is realized during sequence loading page
Manage function.
In order to solve prior art problem, in embodiments of the present invention, reference is based on primary in the page of advertisement to be loaded
The file destination that JavaScript code is write.Also, advertisement position label is previously provided in the HTML code of the page.Wherein,
Advertisement position label is the predetermined html tag for advertisement position occupation.In addition, being provided with advertisement id in advertisement position label.It needs to illustrate
Be.In practical applications, the developer of the page needs first to determine the quantity for needing to launch audience in the page and position, so
Afterwards, at the HTML code corresponding to the position for needing to launch audience, advertisement position label is added, to be reached for advertisement pair
Purpose as carrying out advertisement position occupy-place;In turn, advertisement position id and advertisement id is set for these advertisement position labels.
Wherein, advertisement position id can be used for distinguishing multiple advertisement positions in the page, and advertisement id can be used for distinguishing multiple
Audience.It is emphasized that the embodiment of the present invention is without limitation for the occurrence of advertisement position id and advertisement id.And it is wide
Accusing object can be the picture for showing ad content, and video, text etc., it is not limited in the embodiment of the present invention.
When the page of advertisement to be loaded is loaded, the primary JavaScript code in file destination is performed, real
The corresponding processing function of device of the existing carrying advertisement provided in an embodiment of the present invention in the page, as shown in Fig. 2, the present invention is implemented
Example provide the device 200 of carrying advertisement in the page, may include:
Label detecting unit 201, the advertisement position label in HTML code for detecting the page;
Advertisement id acquiring unit 202, for obtaining advertisement id from detected advertisement position label;
Target data acquiring unit 203, for obtaining target data corresponding with advertisement id from server-side, wherein advertisement
The corresponding target data of id may include the chained address of the corresponding audience of advertisement id;
Audience acquiring unit 204, for obtaining the corresponding audience of advertisement id from chained address;
Audience loading unit 205 is used for the corresponding audience of carrying advertisement id in advertisement position label.
It is corresponding can to obtain advertisement id after getting chained address from chained address for target data acquiring unit 203
Audience, then, audience loading unit 205 is in advertisement position label, the corresponding audience of carrying advertisement id, this
Sample can to show the audience for having load to complete in the page.Illustratively, in a kind of specific implementation, advertisement pair
As loading unit 205 may include:
Label creates subelement, for creating HTML<iframe>label in the advertisement position label;
And object add subelement, for by the corresponding audience of the advertisement id be added to the HTML <
In iframe > label.
In practical applications, HTML<iframe>label is usually used to is embedded in another text in current html document
Shelves.Using iframe carrying advertisement content, do not influenced by the pattern of the page itself, it will not be with the style conflict of the page itself.
It optionally, can be according to previously given about HTML<iframe>label after creating HTML<iframe>label
Setting parameter, HTML<iframe>label is arranged.Wherein, setting parameter may include: HTML<iframe>label
Width, it is high, it can also include the setting options of the dynamic operation of HTML<iframe>label.Here, dynamic operation is such as: load
Complete advertisement hides the advertisement after advertisement, click advertisement are automatically closed after 10 seconds or replaces other advertisements etc. after clicking advertisement.
In addition, in practical applications, it, can be each if in the HTML code of the page including multiple advertisement position labels
The carrying advertisement object in an advertisement position label, then repeats above-mentioned steps, until advertisement position labels whole in the page
Audience is all loaded.Certainly, this process is cracking for a user, and what user was seen on the page can be
Multiple audiences are shown simultaneously.
It is understood that if there are multiple advertisement position labels in HTML code, in the first implementation, whenever
When getting an advertisement id, the corresponding target data of advertisement id can be requested to server-side.In another implementation,
All corresponding target datas of advertisement id can be requested simultaneously to server-side after getting all advertisement id.For
It, can be according to advertisement position id come in the forward end page back page when server-side returns to chained address for two kinds of implementations
Advertisement position label corresponding to correct chained address.
The device of the provided carrying advertisement in the page of the embodiment of the present invention, can execute the page in loading page
Code in the file destination of face reference write based on primary JavaScript code obtains advertisement to realize from server-side
Object is simultaneously loaded into the page.It is write since the target this document is based on primary JavaScript code, when loading page does not need
Method and attribute packaged by front end frame are loaded, therefore, the dress of the provided carrying advertisement in the page of the embodiment of the present invention
It sets, improves the efficiency of page carrying advertisement.In addition, the page for using multiple front end frames, each front end frame is respectively
The method and attribute for encapsulating oneself, often have between multiple frames, and the code encapsulated in method or attribute is different, but packaged
Method or attribute the identical situation of name.In this way, when page carrying advertisement calls these methods or attribute, it is easy to call
Mistake causes code operation to report an error.As provided by the embodiment of the present invention in the page performed by the device of carrying advertisement
The file destination of page reference, is write based on primary JavaScript code, and the page does not need load front end frame institute when loading
The method and attribute of encapsulation, so as to the calling for avoiding the page using multiple front end frames from being easy to appear in carrying advertisement
The situation of mistake.Therefore, the device of the provided carrying advertisement in the page of the embodiment of the present invention also reduces code operation report
Wrong probability.
Optionally, advertisement position label can be using in HTML: HTML<ins>label, HTML<del>label, HTML<
Tag>label, HTML<data>label or HTML<temp>label.These labels belong to the special tag being of little use, and can be used to
Custom Attributes.Also, the standard web page HTML code for meeting specification is not in these above-mentioned html tags, therefore,
Use these labels as advertisement position label, can be distinguished with the label of other in page HTML code.It requires emphasis
It is that the specific tag types of above-mentioned given advertisement position label are merely exemplary, should constitute to of the invention real
Apply the restriction of example.
Optionally, the corresponding target data of advertisement id can also include: the corresponding setting parameter of advertisement id, the setting parameter
For the parameter for the HTML<iframe>label to be arranged.So, correspondingly, object adds subelement, can be specifically used for:
According to setting parameter, HTML<iframe>label is set;After HTML<iframe>label is arranged, by the corresponding advertisement of advertisement id
Object is added in HTML<iframe>label.
In practical applications, setting parameter may include the width of HTML<iframe>label, high, can also include HTML
The dynamic operation setting options of<iframe>label.Here, dynamic operation is such as: being automatically closed after having loaded advertisement 10 seconds wide
It accuses, hide the advertisement after click advertisement or replace other advertisements etc. after clicking advertisement.In addition, dynamic operation can HTML <
It is configured on iframe > label.Here it is possible to which it is multiple to distinguish that iframe label id is arranged for HTML<iframe>label
HTML<iframe>label.Further, it is also possible to play the role of distinguishing with the advertisement position id of advertisement position label.
Optionally, the device of the carrying advertisement provided in an embodiment of the present invention in the page can also include: storage unit.
The storage unit be used for get the corresponding chained address advertisement id and setting parameter when, by chained address and setting parameter with
The form of two-dimensional array is saved.
Correspondingly, audience acquiring unit 204, can be specifically used for: read chained address from two-dimensional array, from chain
Request obtains the corresponding audience of advertisement id in ground connection location.
And object addition subelement can be specifically used for: reading setting parameter from two-dimensional array, join according to setting
HTML<iframe>label is arranged in number;After HTML<iframe>label is set, by audience, it is added to HTML<iframe
In > label.
In this way, obtain chained address and setting parameter be all locally operated, can to avoid with server-side continually
It interacts, saves Internet resources.
It further optionally, can be to be added provided by the embodiment of the present invention in the page in the device of carrying advertisement
Carry the finally reference of HTML code of the advertisement page file destination.It is corresponding, provided by the embodiment of the present invention in the page
For the device of carrying advertisement in loading page, all HTML elements of the page can just load the file destination after all having loaded.
In this way, the page will not be influenced if mistake occurs when loading the file destination leads to file destination load failure
Other upper label normal loads.
Embodiment content in summary it is found that provided by the embodiment of the present invention in the page carrying advertisement device,
The generation in the file destination of page reference write based on primary JavaScript code can be executed in loading page
Code obtains audience from server-side and is loaded into the page to realize.Since the target this document is based on primary
JavaScript code is write, and when loading page does not need method and attribute packaged by load front end frame, therefore, the present invention
The device of the provided carrying advertisement in the page of embodiment, improves the efficiency of page carrying advertisement, also, avoid use
The case where call error that the page of multiple front end frames is easy to appear in carrying advertisement, reduce code operation report an error it is general
Rate.In addition, audience loading unit uses HTML provided by the embodiment of the present invention in the page in the device of carrying advertisement
<iframe>label carrying advertisement content, is not influenced by the pattern of the page itself, will not be with the style conflict of the page itself.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 3, include processor 301, communication interface 302,
Memory 303 and communication bus 304, wherein processor 301, communication interface 302, memory 303 are complete by communication bus 304
At mutual communication;
Memory 303, for storing computer program;
Processor 301, when carrying out page load for executing the program stored on memory 303, cited in the page
Primary JavaScript code in file destination is performed, the method for realizing the carrying advertisement in the page.Wherein, to be loaded wide
The file destination write based on primary JavaScript code is quoted in the page of announcement.Advertisement is provided in the HTML code of the page
Position label, and advertisement id is provided in advertisement position label, advertisement position label is the predetermined html tag for advertisement position occupation.It is a kind of
The method of carrying advertisement in the page, may include steps of:
Detect the advertisement position label in the HTML code of the page;
Advertisement id is obtained from detected advertisement position label;
The corresponding target data of advertisement id is obtained from server-side;The corresponding target data of advertisement id includes advertisement id corresponding
Chained address;
The corresponding audience of advertisement id is obtained from chained address;
In advertisement position label, the corresponding audience of carrying advertisement id.
Optionally, advertisement position label, may include: HTML<ins>label, HTML<del>label, HTML<tag>label,
HTML<data>label or HTML<temp>label.
Optionally, in advertisement position label, the corresponding audience of carrying advertisement id may include:
In the advertisement position label, HTML<iframe>label is created;
The corresponding audience of the advertisement id is added in the HTML<iframe>label.
Optionally, the corresponding target data of advertisement id can also include: the corresponding setting parameter of advertisement id, and setting parameter is
For the parameter of HTML<iframe>label to be arranged.
Therefore, the corresponding audience of advertisement id is added in the HTML<iframe>label, may include:
According to setting parameter, HTML<iframe>label is set;
After HTML<iframe>label is set, by the corresponding audience of advertisement id, it is added to HTML<iframe>mark
In label.
Optionally, this method can also include: when getting chained address and setting parameter, by chained address and setting
Parameter is saved in the form of two-dimensional array.
It may include: to be read from two-dimensional array correspondingly, obtaining the corresponding audience of advertisement id from chained address
Chained address, request obtains the corresponding audience of the advertisement id from chained address.
And according to setting parameter, HTML<iframe>label is set, it may include: that setting is read from two-dimensional array
HTML<iframe>label is arranged according to setting parameter in parameter.
The there is provided electronic equipment of the embodiment of the present invention, can in loading page, execute the page reference based on primary
The code in file destination that JavaScript code is write obtains audience from server-side and is loaded into page to realize
Face.It is write since the target this document is based on primary JavaScript code, when loading page does not need load front end frame institute
The method and attribute of encapsulation, therefore, electronic equipment provided by the embodiment of the present invention improve the efficiency of page carrying advertisement,
Also, the case where avoiding the call error being easy to appear using the page of multiple front end frames in carrying advertisement, is reduced
Code runs the probability to report an error.In addition, electronic equipment provided by the embodiment of the present invention, is loaded using HTML<iframe>label
Ad content is not influenced by the pattern of the page itself, will not be with the style conflict of the page itself.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can
It reads to be stored with instruction in storage medium, when it runs on computers carries out page load, file destination cited in the page
In primary JavaScript code be performed, realize in the page carrying advertisement method.Wherein, the page of advertisement to be loaded
It is middle to quote the file destination write based on primary JavaScript code.Advertisement position label is provided in the HTML code of the page,
And advertisement id is provided in advertisement position label, advertisement position label is the predetermined html tag for advertisement position occupation.One kind is in the page
The method of middle carrying advertisement, may include steps of:
Detect the advertisement position label in the HTML code of the page;
Advertisement id is obtained from detected advertisement position label;
The corresponding target data of advertisement id is obtained from server-side;The corresponding target data of advertisement id includes advertisement id corresponding
The chained address of audience;
The corresponding audience of advertisement id is obtained from chained address;
In advertisement position label, the corresponding audience of carrying advertisement id.
Optionally, advertisement position label, may include: HTML<ins>label, HTML<del>label, HTML<tag>label,
HTML<data>label or HTML<temp>label.
Optionally, in advertisement position label, the corresponding audience of carrying advertisement id may include:
In the advertisement position label, HTML<iframe>label is created;
The corresponding audience of the advertisement id is added in the HTML<iframe>label.
Optionally, the corresponding target data of advertisement id can also include: the corresponding setting parameter of advertisement id, and setting parameter is
For the parameter of HTML<iframe>label to be arranged.
Therefore, the corresponding audience of advertisement id is added in the HTML<iframe>label, may include:
According to setting parameter, HTML<iframe>label is set;
After HTML<iframe>label is set, by the corresponding audience of advertisement id, it is added to HTML<iframe>mark
In label.
Optionally, this method can also include: when getting chained address and setting parameter, by chained address and setting
Parameter is saved in the form of two-dimensional array.
It may include: from the two-dimensional array correspondingly, obtaining the corresponding audience of advertisement id from chained address
The chained address is read, request obtains the corresponding audience of the advertisement id from the chained address.
And according to setting parameter, HTML<iframe>label is set, it may include: that setting is read from two-dimensional array
HTML<iframe>label is arranged according to setting parameter in parameter.
The there is provided computer readable storage medium of the embodiment of the present invention, when the instruction that it is stored run on computers into
When the row page loads, the generation in the file destination of page reference write based on primary JavaScript code can be executed
Code obtains audience from server-side and is loaded into the page to realize.Since the target this document is based on primary
JavaScript code is write, and when loading page does not need method and attribute packaged by load front end frame, therefore, the present invention
Computer readable storage medium provided by embodiment, improves the efficiency of page carrying advertisement, also, avoids using multiple
The case where call error that the page of front end frame is easy to appear in carrying advertisement, reduces code and runs the probability to report an error.
In addition, computer readable storage medium provided by the embodiment of the present invention, using HTML<iframe>label carrying advertisement content,
It is not influenced by the pattern of the page itself, it will not be with the style conflict of the page itself.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just
It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy
The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete
Door or transistor logic, discrete hardware components.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.It is set especially for electronics
For standby and computer readable storage medium embodiment, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (10)
1. a kind of method of the carrying advertisement in the page, which is characterized in that reference is based on primary in the page of advertisement to be loaded
The file destination that JavaScript code is write is provided with advertisement position label, the advertisement position in the HTML code of the page
Advertisement id is provided in label, the advertisement position label is the predetermined html tag for advertisement position occupation;
When the page is loaded, the primary JavaScript code in the file destination is performed, and is realized in the page
The method of carrying advertisement, which comprises
Detect the advertisement position label in the HTML code of the page;
The advertisement id is obtained from detected advertisement position label;
The corresponding target data of the advertisement id is obtained from server-side;The corresponding target data of the advertisement id includes the advertisement
The corresponding chained address id;
The corresponding audience of the advertisement id is obtained from the chained address;
In the advertisement position label, the corresponding audience of the advertisement id is loaded.
2. the method according to claim 1, wherein the advertisement position label, comprising:
HTML<ins>label, HTML<del>label, HTML<tag>label, HTML<data>label or HTML<temp>label.
3. method according to claim 1 or 2, which is characterized in that it is described in the advertisement position label, it loads described wide
Accuse the corresponding audience of id, comprising:
In the advertisement position label, HTML<iframe>label is created;
The corresponding audience of the advertisement id is added in the HTML<iframe>label.
4. according to the method described in claim 3, it is characterized in that, the corresponding target data of the advertisement id further include: described
The corresponding setting parameter of advertisement id;The setting parameter is the parameter for the HTML<iframe>label to be arranged;
It is described that the corresponding audience of advertisement id is added in the HTML<iframe>label, comprising:
According to the setting parameter, the HTML<iframe>label is set;
After HTML<iframe>label is set, by the corresponding audience of the advertisement id, be added to the HTML<
In iframe > label.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
When getting the chained address and the setting parameter, by the chained address and the setting parameter with two-dimemsional number
The form of group is saved;
It is described that the corresponding audience of the advertisement id is obtained from chained address, comprising:
The chained address is read from the two-dimensional array, it is corresponding to obtain the advertisement id for request from the chained address
Audience;
It is described according to the setting parameter, the HTML<iframe>label is set, comprising:
The setting parameter is read from the two-dimensional array, and according to the setting parameter, the HTML<iframe>mark is set
Label.
6. a kind of device of the carrying advertisement in the page, which is characterized in that reference is based on primary in the page of advertisement to be loaded
The file destination that JavaScript code is write is provided with advertisement position label, the advertisement position in the HTML code of the page
Advertisement id is provided in label, the advertisement position label is the predetermined html tag for advertisement position occupation;
When the page is loaded, the primary JavaScript code in the file destination is performed, and is realized in the page
The corresponding processing function of the device of carrying advertisement, described device include:
Label detecting unit, the advertisement position label in the HTML code for detecting the page;
Advertisement id acquiring unit, for obtaining the advertisement id from detected advertisement position label;
Target data acquiring unit, for obtaining the corresponding target data of the advertisement id from server-side;The advertisement id is corresponding
Target data include the corresponding chained address the advertisement id;
Audience acquiring unit, for obtaining the corresponding audience of the advertisement id from the chained address;
Audience loading unit, for loading the corresponding audience of the advertisement id in the advertisement position label.
7. device according to claim 6, which is characterized in that the advertisement position label, comprising:
HTML<ins>label, HTML<del>label, HTML<tag>label, HTML<data>label or HTML<temp>label.
8. device according to claim 6 or 7, which is characterized in that the audience loading unit, comprising:
Label creates subelement, for creating HTML<iframe>label in the advertisement position label;
Object adds subelement, for the corresponding audience of the advertisement id to be added to the HTML<iframe>label
In.
9. device according to claim 8, which is characterized in that the corresponding target data of the advertisement id further include: described
The corresponding setting parameter of advertisement id, the setting parameter are the parameter for the HTML<iframe>label to be arranged;
The object adds subelement, is specifically used for:
According to the setting parameter, the HTML<iframe>label is set;
After HTML<iframe>label is set, by the corresponding audience of the advertisement id, be added to the HTML<
In iframe > label.
10. device according to claim 9, which is characterized in that described device further include: storage unit;The preservation is single
Member, for when getting the chained address and the setting parameter, by the chained address and the setting parameter with two
The form of dimension group is saved;
The audience acquiring unit, is specifically used for: the chained address is read from the two-dimensional array, from the link
Request obtains the corresponding audience of the advertisement id in address;
The object adds subelement, is specifically used for:
The setting parameter is read from the two-dimensional array, and according to the setting parameter, the HTML<iframe>mark is set
Label;
After HTML<iframe>label is set, by the corresponding audience of the advertisement id, be added to the HTML<
In iframe > label.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811237038.5A CN109408762A (en) | 2018-10-23 | 2018-10-23 | A kind of method and device of the carrying advertisement in the page |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811237038.5A CN109408762A (en) | 2018-10-23 | 2018-10-23 | A kind of method and device of the carrying advertisement in the page |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109408762A true CN109408762A (en) | 2019-03-01 |
Family
ID=65468410
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811237038.5A Pending CN109408762A (en) | 2018-10-23 | 2018-10-23 | A kind of method and device of the carrying advertisement in the page |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109408762A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111931089A (en) * | 2020-06-28 | 2020-11-13 | 北京摩迅筑路机械有限公司 | Front-end page information flow advertisement display method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103279878A (en) * | 2013-05-22 | 2013-09-04 | 广州威信信息科技发展有限公司 | Precise interactive digital television advertisement putting system and method |
CN104268282A (en) * | 2014-10-15 | 2015-01-07 | 李阳 | Web banner advertisement displaying method and system |
US9691080B1 (en) * | 2013-10-15 | 2017-06-27 | Rocket Fuel Inc. | First party cookie attribution |
CN107197334A (en) * | 2017-07-14 | 2017-09-22 | 环球智达科技(北京)有限公司 | A kind of advertisement obtains system |
-
2018
- 2018-10-23 CN CN201811237038.5A patent/CN109408762A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103279878A (en) * | 2013-05-22 | 2013-09-04 | 广州威信信息科技发展有限公司 | Precise interactive digital television advertisement putting system and method |
US9691080B1 (en) * | 2013-10-15 | 2017-06-27 | Rocket Fuel Inc. | First party cookie attribution |
CN104268282A (en) * | 2014-10-15 | 2015-01-07 | 李阳 | Web banner advertisement displaying method and system |
CN107197334A (en) * | 2017-07-14 | 2017-09-22 | 环球智达科技(北京)有限公司 | A kind of advertisement obtains system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111931089A (en) * | 2020-06-28 | 2020-11-13 | 北京摩迅筑路机械有限公司 | Front-end page information flow advertisement display method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111104635B (en) | Method and device for generating form webpage | |
CN108156022A (en) | A kind of service calling method, device and electronic equipment | |
CN107609156A (en) | The method and device that a kind of page is built | |
CN104881318B (en) | A kind of interface call method, device and terminal | |
CN110912803B (en) | IM message transmission method and terminal | |
CN104243273A (en) | Method and device for displaying information on instant messaging client and information display system | |
CN106897216A (en) | The method and apparatus of test software | |
CN108572823A (en) | Front and back end development management method and system based on interface engine | |
CN111831542B (en) | API application debugging method and device and storage medium | |
CN105488125A (en) | Page access method and apparatus | |
CN107329991A (en) | A kind of list access to web page and methods of exhibiting and its system | |
CN114240358A (en) | Method, device, equipment and medium for realizing user-defined business process | |
CN105718512A (en) | Method for calling native language by using JS language in Ios system | |
CN113923144A (en) | Service test system, method, electronic device and storage medium | |
CN110647634B (en) | Method and device for searching media resources, storage medium and electronic device | |
CN109862399A (en) | It shows the method for rich media information, handle method, computer installation and the computer readable storage medium of rich media information | |
CN109408762A (en) | A kind of method and device of the carrying advertisement in the page | |
CN109032693A (en) | Method and device for loading display information, electronic equipment and readable storage medium | |
CN110673827B (en) | Resource calling method and device based on android system and electronic equipment | |
CN106095886B (en) | Data processing method and device | |
CN112818270A (en) | Data cross-domain transfer method and device and computer equipment | |
CN104461509A (en) | Information interaction framework and method | |
CN116739524A (en) | Business process setting method, device, equipment, storage medium and program product | |
CN103200266B (en) | To method, network applications manager and system that network application manages | |
CN110908680A (en) | Information processing method, device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190301 |
|
WD01 | Invention patent application deemed withdrawn after publication |