循环不工作的JavaScript

时间:2013-05-14 21:27:27

标签: javascript loops imacros

如何用javascript

循环imm(imacros)脚本 你可以帮帮我吗?

macro +=  "URL GOTO=http://test.com/" + "\n"; 
macro +=  "SET !ERRORIGNORE YES" + "\n"; 
macro +=  "SET !TIMEOUT_PAGE 10" + "\n"; 
macro +=  "SET !EXTRACT NULL " + "\n"; 
macro +=  "wait seconds=1" + "\n"; 
macro +=  "TAG POS={{i}} TYPE=A ATTR=ID:like-*" + "\n"; 
macro +=  "wait seconds=0.5" + "\n"; 
macro +=  "WAIT SECONDS=360" + "\n"; 
for(i=1;i<10;i++)
{
ret=iimSet("i",i);
ret=iimPlay(macro);
}

1 个答案:

答案 0 :(得分:1)

var macro;

    macro =  "CODE:";
    macro +=  "URL GOTO=http://test.com/" + "\n"; 
    macro +=  "SET !ERRORIGNORE YES" + "\n"; 
    macro +=  "SET !TIMEOUT_PAGE 10" + "\n"; 
    macro +=  "SET !EXTRACT NULL " + "\n"; 
    macro +=  "wait seconds=1" + "\n"; 
    macro +=  "TAG POS={{i}} TYPE=A ATTR=ID:like-*" + "\n"; 
    macro +=  "wait seconds=0.5" + "\n"; 
    macro +=  "WAIT SECONDS=360" + "\n"; 
    for(i=1;i<10;i++)
    {
    iimSet("i",i);
    ret=iimPlay(macro);
    }

立即尝试。

编辑:更正了上一个错误。