Just saw a buddy wrote a jquery plugin countdown-buy seconds kill suddenly think of an idea is title
Idea: Now many places have similar seconds to kill, snapping, such as speed, speed (in fact, the server slag, such as: a meter), many people think can write a client, open has been brush,
I think I should be able to directly through the JS code to execute. Get down to the chase.
If you know and will use the browser developer tools is very good to do, I used to use chrome, this example also use Chrome
F12 Open Developer Tools
In the console directly input JS band can be executed, so we should have a clue
Test:
Write a test page
< Div > < > time:<id= "SPView"></ span></div></div>
Corresponding JS
$(function() { varOutime = 30; varView = $ ("#spView"); varInterval = SetInterval (function() {outime--; if(Outime = = 0) {clearinterval (interval); View.html (""); varBTN = $ ("<input type= ' button ' value= ' Open Rob '/>"); View.append (BTN); Btn.on ("Click",function() {alert ("I Rob!"); }); } Else{view.html (outime); } }, 1000);});
This is a very simple countdown, 30 seconds after the countdown to give the "Rob" button
Then we can build our own snapped JS.
Directly on the code
SetInterval (function () { var txt= $ ("#spView"). html (); if (IsNaN (TXT)) { // This decision can be determined according to the status of the page, determine whether you can start snapping // execute the corresponding button event 1000);
This time you only need to copy this code, and then in the snapping page F12 in the console paste this code, and enter the execution
This solution is simple, regardless of post content
But you have to log in to the system first.
A sentence JS to help you kill, snapping