JavaScript function() bug

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.
Forum rules
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
Post Reply
mikeeam
Posts: 10
Joined: Thu Jul 07, 2011 4:54 pm

JavaScript function() bug

Post by mikeeam » Fri Apr 19, 2013 8:37 pm

Hello!

Whenever I use this code

Code: Select all

setTimeout(function(){document.getElementById('t_item000100_10').click();},500);
if({{!VAR1}}>0&&{{!VAR2}}>0){
	setTimeout(function(){document.getElementById('t_item000100_10_12').click();},500);
    setTimeout(function(){document.getElementById('t_item000100_10_15').click();},500);
}else{
	if({{!VAR1}}>0){
	setTimeout(function(){document.getElementById('t_item000100_10').click();},500);
	setTimeout(function(){document.getElementById('t_item000100_10_12').click();},500);
        }else{
	setTimeout(function(){document.getElementById('t_item000100_10').click();},500);
	setTimeout(function(){document.getElementById('t_item000100_10_15').click();},500);
}
}
This is the iMacros version:

Code: Select all

URL GOTO=javascript:setTimeout(function(){document.getElementById('t_item000100_10').click();},500);if({{!VAR1}}>0&&{{!VAR2}}>0){setTimeout(function(){document.getElementById('t_item000100_10_12').click();},500);setTimeout(function(){document.getElementById('t_item000100_10_15').click();},500);}else{if({{!VAR1}}>0){setTimeout(function(){document.getElementById('t_item000100_10').click();},500);setTimeout(function(){document.getElementById('t_item000100_10_12').click();},500);}else{setTimeout(function(){document.getElementById('t_item000100_10').click();},500);setTimeout(function(){document.getElementById('t_item000100_10_15').click();},500);}}
The macro just go to the URL "setTimeout(function(){document.getElementById('t_item000100_10').click();},500);".
It leaves the page, in the same tab, and it appears in the url.

Is this a bug??
Post Reply