title: Check if html element exists with iMacros and javascript
body: <p>I want to check if an HTML element exist with iMacros. If it does, I want to go to a URL. If not, I want to go to other URL. </p>
  
  <p>Because iMacros doesn't have statements, I used javascript with the iMacros' EVAL.
  Here is the line that handles the javascript execution:</p>
  
  <pre><code>SET !VAR3 EVAL("var element = window.content.document.getElementById(\"some_element\");
  if (typeof(element) != 'undefined' &amp;&amp; element != null) { 
  var redirect = 'http://192.168.178.22/sc/report.php'; 
  } else { 
  var redirect = 'http://192.168.178.22/sc/index.php?action=connect'; 
  } 
  redirect;
  ")
  </code></pre>
  
  <p>*It's all in one line, but I formatted it for here.</p>
  
  <p>Then, I will redirect with</p>
  
  <pre><code>URL GOTO={{!VAR3}}
  </code></pre>
  
  <p>The problem is in both of the cases, the !VAR3 is set to 'undefined.'</p>
  
  <p>I tried almost the same JS code on Firefox only, and it seems to be working.</p>
  
  <p>Windows 8 with the latest Firefox and the latest iMacros version.</p>
  
  <p>Thank you.</p>