Last active
March 14, 2019 03:55
-
-
Save guanguans/86b2fd54641967f3662f3d43d31232c0 to your computer and use it in GitHub Desktop.
12306.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadScript(url, callback){ | |
var script = document.createElement ("script") | |
script.type = "text/javascript"; | |
if (script.readyState){ //IE | |
script.onreadystatechange = function(){ | |
if (script.readyState == "loaded" || script.readyState == "complete"){ | |
script.onreadystatechange = null; | |
script.parentNode.removeChild(script); | |
callback(); | |
} | |
}; | |
} else { | |
script.onload = function(){ | |
script.parentNode.removeChild(script); | |
callback(); | |
}; | |
} | |
script.src = url; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} | |
loadScript('https://f.jazor.net/12306/1.0.js', function(){ | |
tool2.setup({ | |
date : '2019-02-01', | |
from : 'HGH', | |
to : 'JNK', | |
//G254,G34,G1862,G20,G1224,G58,G36,G42,G46,G1228,G38,G168,G56,G32 | |
trains : 'G20,G254,G34,G1862,G1224,G58,G36,G42,G46,G1228,G38,G168,G56,G32', | |
seats : 'ze', //swz,tz,zy,ze,gr,rw,yw,rz,yz,wz,qt | |
username : 'xxxxxxxx', | |
password : 'xxxxxx' | |
}); | |
var start = function(){ | |
tool2.start(); | |
return 'Start OK.'; | |
}; | |
var stop = function(){ | |
tool2.stop(); | |
return 'Stop OK.'; | |
}; | |
start(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment