How can I call "stop()" at HTML?
It's inside of downloadFile2().
js example
function download() {
var req = request({
method: 'GET',
uri: url
});
var out = fs.createWriteStream(path);
req.pipe(out);
function stop(){
req.pause();
}
req.on('response', function(data) {
});
req.on('data', function(chunk) {
stop();//I want to execute this method at html .
});
}
html
<tr><td><a class="checkBtn" onclick="downloadFile2(event)">download</a></td><td><a class="checkBtn" onclick="downloadFile2.innerfunc();" value="ACTION">stop~!!!</a></td></tr>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…