我有一个 javascript 代码,它首先在 imacros 中工作,但现在它不起作用。循环不播放。谁能告诉我为什么会发生这种情况。下面是代码。
请解决这个问题,为什么现在这个 javascript 在 imacros 中不起作用。
var i, retcode;
\var report;
var macrolist = new Array();
/* Standard Demo Macros */
macrolist.push("Demo-Firefox/FillForm.iim");
macrolist.push("Demo-Firefox/Frame.iim");
macrolist.push("Demo-Firefox/Filter.iim");
macrolist.push("Demo-Firefox/Tabs.iim");
macrolist.push("Demo-Firefox/Javascript-Dialogs.iim");
macrolist.push("Demo-Firefox/SlideShow.iim");
macrolist.push("Demo-Firefox/TagPosition.iim");
/* Macros that save something and/or create logs */
macrolist.push("Demo-Firefox/Download.iim");
macrolist.push("Demo-Firefox/SaveAs.iim");
macrolist.push("Demo-Firefox/SavePDF.iim");
/* Macros that create reports */
macrolist.push("Demo-Firefox/Stopwatch.iim");
/* Macros that extract information */
macrolist.push("Demo-Firefox/ExtractAndFill.iim");
macrolist.push("Demo-Firefox/Extract.iim");
macrolist.push("Demo-Firefox/ExtractURL.iim");
macrolist.push("Demo-Firefox/ExtractRelative.iim");
iimDisplay("Start Self Test");
report = "Self-Test Report\n\n";
for (i = 0; i < macrolist.length; i++) {
iimDisplay("Step "+(i+1)+" of "+macrolist.length + "\nMacro: "+macrolist[i]);
retcode = iimPlay(macrolist[i]);
report += macrolist[i];
if (retcode < 0) {
report += ": "+iimGetLastError();
} else {
report += ": OK";
/* display the FIRST extracted item in report*/
s = iimGetLastExtract(1);
if ( s != "" ) report += ", Extract: "+s;
}
report += "\n";
}
iimDisplay("Test complete");
alert ( report );