imacros: javascript i get www._undefined_.com error

心不动则不痛 提交于 2020-01-03 03:08:30

问题


so when i run this macro in imacros it directs me to www.undefined.com any ideas how i can fix this?

also: it directs me to the first url but when it loops the second time it gets to that site

var macro;

macro ="CODE:";
macro +="VERSION BUILD=8601111 RECORDER=FX"+"\n";
macro +="TAB T=1"+"\n";
macro +="TAB CLOSEALLOTHERS"+"\n";
macro +="URL GOTO={{random}}"+"\n";

var am = "www.google.com"
var amc = "www.youtube.com"
var amb = "www.yahoo.com"


var link=[am, amc, amb];

#this is for selecting a random value

var random = Math.floor((Math.random() * 2));
iimSet("link",link[random])
iimPlay(macro)

#this is for looping 10 times

var n=10;




for(var i=0;i<n;i++)

{

iimPlay(macro)
}

回答1:


Once again. Just apply this:

var random = Math.floor(Math.random()*link.length);

And according to your iim-code, set 'random' instead of 'link' :

iimSet("random",link[random]);


来源:https://stackoverflow.com/questions/32904881/imacros-javascript-i-get-www-undefined-com-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!