CN106603185A - Webpage countdown method based on time of server - Google Patents
Webpage countdown method based on time of server Download PDFInfo
- Publication number
- CN106603185A CN106603185A CN201611061491.6A CN201611061491A CN106603185A CN 106603185 A CN106603185 A CN 106603185A CN 201611061491 A CN201611061491 A CN 201611061491A CN 106603185 A CN106603185 A CN 106603185A
- Authority
- CN
- China
- Prior art keywords
- time
- server
- client
- countdown
- service end
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a webpage countdown method based on the time of a server. Since the time of a client obtained by javascript has errors, namely the time on the webpage is accordingly changed as long as a visitor modifies the time of a computer of the client thereof, and inconvenience is brought to some shopping platforms. According to the method, the time of the server is obtained by employing php so that normal display of countdown is not affected by modification of the date and time at the server, namely the time is subjected to the time of the server. According to the method, the defect in the prior art is overcome, and the system avoids the condition that different clients display different results through obtaining of the time of the server.
Description
Technical field
The present invention relates to webpage countdown technical field, particularly belongs to a kind of webpage countdown that can recognize the service end time
Method.
Background technology
With the development of the Internet, online shopping mall is also being continuously increased, and occurs in that Taobao, and Jingdone district, only product meeting is waited when working as.
It is convenient that the shopping that the appearance of online shopping mall gives people is provided, the home-confined commodity that just can have bought oneself needs.In interconnection
Today of net information explosion, shopping online has become the most important approach that people buy commodity.
And countdown is the requisite technology of each online shopping mall, because each store can do some flash sales
Preferential activity is attracting user.Countdown comes from earliest rocket inverse launching procedure, extensively refers to other necks by people later
Domain.Just started simply to carry out inverse to numeral, till now to the accurate countdown of time, countdown through decades development,
Technology relative maturity, and because there is successful business model to use, thus attracted numerous the Internet manufacturers to quote.Jing
Normal visible large-scale online shopping mall such as Jingdone district, only product can be waited, and Jing often does sale activity and uses countdown technology.
It is exactly to obtain the service end time that the first step for realizing countdown is also a most important step, in view of javascript is obtained
There is error in the client time for taking, as long as that is, visitor changes the time of its client computer, the time on webpage also changes therewith
Become.To solve problems, we carry out countdown using the php acquisition service end times.When service end is to client transmission data
Server time is sent, client is processed when receiving is set to server time by count down time.
Second kills movable countdown process, is asked for relying on different clients time, entanglement time of client countdown
Topic, so some problems can be faced with.
1st, because user voluntarily can change client time, so relying on the mistake that client time will be in generation time
Difference, such second activity of killing is over, but client voluntarily have modified the time of oneself computer, and this commodity will be shown still in the second
Kill, will go wrong during purchase.Because the time of client is insecure, the current time is had to from server
Obtain.Then server time is sent when service end sends data to client, is processed when client receives, by countdown
Set of time is server time.But yet suffer from the actual central speed problem due to network speed or mobile phone of application
Problem.
2nd, the time of network transmission and render code the execution time be all error exist factor.
Currently for countdown main stream approach be obtain service end time, then calculate network transmission time and
The execution time of rendering program.Present system time=server system time+network latency+render time+constant.
In implementation procedure, necessarily there is the time portion that cannot be calculated, can be made up the difference with constant.As long as with regard to render time in execution
Start at ending set start and end time just can calculate.
The content of the invention
It is an object of the invention to provide a kind of webpage countdown method based on server time, overcomes prior art
Deficiency, instant invention overcomes the deficiencies in the prior art, make system pass through to obtain the time of server, it is to avoid different clients it
Between show Different Results.
For achieving the above object, the present invention provides following technical scheme:
A kind of webpage countdown method based on the service end time, when client countdown, based on server time, it is to avoid
Different Results are shown before different clients;When service end is to client transmission data, server time is sent, client is received
When, processed and count down time is set to into server time.
When described service end is to client transmission data, sends server time and comprise the steps of:
When service end is to client transmission data, server time is sent, when client is received, processed count down time
It is set to server time;
To the system request time, system completes response to client, and service end to client sends data and time, client according to
Movable time started and system time do countdown and show.
Compared with prior art, the invention has the beneficial effects as follows:The method that invention obtains the service end time using php, this
Method solves the normal display that user side modification date-time does not interfere with countdown, i.e., be defined by server time.This
It is bright to overcome the deficiencies in the prior art, make system pass through to obtain the time of server, it is to avoid difference is shown between different clients
As a result.Fundamentally solve client time different display Different Results.
Description of the drawings
Fig. 1 is prior art countdown process sketch;
Fig. 2 is countdown process sketch of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
A kind of webpage countdown method based on server time that the present invention is provided, in view of what javascript was obtained
There is error in client time, as long as that is, visitor changes the time of its client computer, the time on webpage also changes therewith, gives
Some shopping platforms are made troubles, and the present invention obtains the service end time using php, when the method solves the user side modification date
Between do not interfere with the normal display of countdown, i.e., be defined by server time.Instant invention overcomes the deficiencies in the prior art, make be
The time that system passes through acquisition server, it is to avoid Different Results are shown between different clients.
The webpage countdown method of described service end time is specifically comprised the steps of:
(1)Client is to the system request time;
(2)System completes response;
(3)Service end to client sends data and time;
(4)Client is done countdown and is shown according to movable time started and system time.
The webpage countdown method of described service end time does not consider that the time-consuming realization of network is comprised the steps of:
(1)Page table entry server initiates time during AJAX request;
(2)Simultaneously time of return was stabbed to the time of the page for the request of server response page;
(3)The page receives the timestamp of server return and starts the time of timing;
(4)The time that server countdown terminates is sent to the time that page countdown terminates, while being also user in countdown
The time of button is clicked in end that time;
As can be seen that the problem of the method existence time error.
(1)The webpage countdown method of described service end time considers that the time-consuming realization of network is comprised the steps of:
(2)Page table entry server initiates time during AJAX request;
(3)Simultaneously time of return was stabbed to the time of the page for the request of server response page;
(4)The page receives the timestamp of server return and starts the time of timing;
(5)The time that server countdown terminates is sent to the time that page countdown terminates, while being also user in countdown
The time of button is clicked in end that time;
(6)Network transmission do not taken process in the case of time for terminating of webpage countdown, server countdown knot
The time of beam;
Network transmission do not taken process in the case of server receive time of user's click information.
Using the time advance page for terminating countdown receive server return timestamp and start timing when
Between and the page to server initiate AJAX request when time.Solve network transmission and take the error problem for causing.
It is obvious to a person skilled in the art that the invention is not restricted to the details of above-mentioned one exemplary embodiment, Er Qie
In the case of spirit or essential attributes without departing substantially from the present invention, the present invention can be in other specific forms realized.Therefore, no matter
From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, the scope of the present invention is by appended power
Profit is required rather than described above is limited, it is intended that all in the implication and scope of the equivalency of claim by falling
Change is included in the present invention.Any reference in claim should not be considered as and limit involved claim.
Claims (2)
1. a kind of webpage countdown method based on the service end time, it is characterised in that:When client countdown, based on clothes
The business device time, it is to avoid Different Results are shown before different clients;When service end is to client transmission data, when sending server
Between, when client is received, processed and count down time is set to into server time.
2. a kind of webpage countdown method based on the service end time according to claim 1, it is characterised in that:Described
When service end is to client transmission data, sends server time and comprise the steps of:
When service end is to client transmission data, server time is sent, when client is received, processed count down time
It is set to server time;
To the system request time, system completes response to client, and service end to client sends data and time, client according to
Movable time started and system time do countdown and show.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611061491.6A CN106603185A (en) | 2016-11-28 | 2016-11-28 | Webpage countdown method based on time of server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611061491.6A CN106603185A (en) | 2016-11-28 | 2016-11-28 | Webpage countdown method based on time of server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106603185A true CN106603185A (en) | 2017-04-26 |
Family
ID=58593484
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611061491.6A Pending CN106603185A (en) | 2016-11-28 | 2016-11-28 | Webpage countdown method based on time of server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106603185A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108564416A (en) * | 2018-04-25 | 2018-09-21 | 掌阅科技股份有限公司 | The processing method of activity countdown in limited time, computing device, storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102215224A (en) * | 2011-05-20 | 2011-10-12 | 深圳市金槌拍卖行有限公司 | Network countdown accurate-synchronization technology |
CN102346891A (en) * | 2010-07-30 | 2012-02-08 | 阿里巴巴集团控股有限公司 | Network transaction method and server |
CN104933079A (en) * | 2014-03-21 | 2015-09-23 | 阿里巴巴集团控股有限公司 | Browser timing method and system |
CN105321107A (en) * | 2015-06-25 | 2016-02-10 | 苏州蜗牛数字科技股份有限公司 | Method and system for participating in network transaction by mobile terminal |
CN105871647A (en) * | 2016-06-17 | 2016-08-17 | 武汉斗鱼网络科技有限公司 | Time asynchronous reference method and system for communication of client with server |
-
2016
- 2016-11-28 CN CN201611061491.6A patent/CN106603185A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102346891A (en) * | 2010-07-30 | 2012-02-08 | 阿里巴巴集团控股有限公司 | Network transaction method and server |
CN102215224A (en) * | 2011-05-20 | 2011-10-12 | 深圳市金槌拍卖行有限公司 | Network countdown accurate-synchronization technology |
CN104933079A (en) * | 2014-03-21 | 2015-09-23 | 阿里巴巴集团控股有限公司 | Browser timing method and system |
CN105321107A (en) * | 2015-06-25 | 2016-02-10 | 苏州蜗牛数字科技股份有限公司 | Method and system for participating in network transaction by mobile terminal |
CN105871647A (en) * | 2016-06-17 | 2016-08-17 | 武汉斗鱼网络科技有限公司 | Time asynchronous reference method and system for communication of client with server |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108564416A (en) * | 2018-04-25 | 2018-09-21 | 掌阅科技股份有限公司 | The processing method of activity countdown in limited time, computing device, storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104111975B (en) | The method and device of information push | |
TWI657345B (en) | Operational simulation method, device and system for business objects | |
TW201317805A (en) | Web address information providing and sharing method, friend adding method, and corresponding equipment | |
CN104967644B (en) | Information push method, apparatus and system | |
CN105843814A (en) | Method, device, and system for generating page | |
WO2017133329A1 (en) | Information processing method, server, first terminal and computer storage medium | |
JP2005536790A5 (en) | ||
TWI578249B (en) | A method and a picture generating apparatus and a system for generating an image on an instant messaging client | |
JP2012503823A5 (en) | ||
US9449337B2 (en) | Emulation of a client browser and generation of web page data by an electronic commerce server in a testing environment having a separate test server | |
CN106030643A (en) | Apparatus and method for peer-assisted e-commerce shopping | |
EP2808837A1 (en) | Sales promotion device, sales promotion system, and sales promotion method | |
TWI656768B (en) | Method, system, client device and server for providing internet application service | |
CN104717131B (en) | Information interacting method and server | |
CN109934691A (en) | A kind of data processing method of auction, auction client and system | |
KR101033853B1 (en) | The apparatus and method of hybrid advertisement with local zone and social network | |
JP2017534214A5 (en) | ||
CN107357810B (en) | A kind of method and system for landing page for exporting special topic | |
CN106603185A (en) | Webpage countdown method based on time of server | |
CN106330662A (en) | Group establishment method and device for social platform | |
CN109218272A (en) | Media content method for pushing, device, server, system and storage medium | |
US20120131037A1 (en) | Asynchronous online searches | |
WO2013135163A1 (en) | Method, system and device for obtaining potential friends information | |
KR101110617B1 (en) | Method for providing online shopping malls promotion service based social network | |
TW201329756A (en) | Service systems and methods |
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: 20170426 |
|
WD01 | Invention patent application deemed withdrawn after publication |