I'm trying to run a javascript loop and having a problem:
for (var i=1;i<=40;i++)
{
iimPlayCode("TAG POS={{i}} TYPE=IMG ATTR=SRC:http://*.jpg")
}
it loops through the code just fine, but it won't click on the TAG POS=1,2,3, ... 40
it runs other commands inside the loop that don't depend on a variable, just not the line that has the variable in it...
simple js loop not working
Forum rules
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
iMacros EOL - Attention!
The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely,
The Progress Team
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Re: simple js loop not working
Code: Select all
for (var i=1;i<=40;i++)
{
iimSet("i",i);
iimPlayCode("TAG POS={{i}} TYPE=IMG ATTR=SRC:http://*.jpg")
}
Get Best iMacros scripts at http://imacrosbot.com/
Re: simple js loop not working
Thanks that works!
Re: simple js loop not working
now my problem is that my code isn't perfect, because the data on the page varies too much, so it tries to close tab 2 but it's really only in tab 1, so how do I put a javascript if operator on the tab and say "only close tab if you are in tab 2" and leave tab 1 open
what it's doing is closing tab 1 and exiting firefox...
any idea how to do this with javascript?
what it's doing is closing tab 1 and exiting firefox...
any idea how to do this with javascript?