title: Can javascript eval() take variables name and replace them before using
body: <p>Many thanks for reading ,</p>
  
  <p>Problem context: Use search function of spry in more than one accordion panel.</p>
  
  <p>I am trying to use <code>eval</code> (since it is the only way I can think of) to accomplish this simple thing:</p>
  
  <pre><code>var ds1 = new Spry.Data.XMLDataSet("ajaxxmllogdaneiz1.php",'root/row]');
  
  var ds2 = new Spry.Data.XMLDataSet("ajaxxmllogdaneiz2.php",'root/row]');
  
  var str1="ds";
  
  var str2= 1;
  
  var result= str1.concat(str2);
  
  //result is now ds1
  
  eval ("result.filter(filterFunc)");
  </code></pre>
  
  <p>I would like <code>ds1.filter(filterFunc)</code> to be called but <code>result.filter(filterFunc)</code> is called.
  Is there a way for <code>ds1.filter(filterFunc)</code> to be called with <code>eval</code> or alternatives (Jquery?)?
  Many thanks 
  Dinos </p>