title: syntax error on ajax code - unexpected (
body: <p>I am getting an</p>
  
  <pre><code>Uncaught SyntaxError: Unexpected token ( 
  </code></pre>
  
  <p>error on the following ajax code.  The error is on this line:  </p>
  
  <pre><code>function(resultArray) {
  </code></pre>
  
  <p>The code is:</p>
  
  <pre><code>$(document).ready(function() {
  
  displaycars();
  function displaycars () {
      $.ajax({
              type : 'GET',
              url : '/modules/crm/selector-ajax.php',
              data : {
                  'action' : 'get-images'
              },
              success : function(result) {
  
                  var selectorDiv = $('#car_isotope_gallery');
  
              var resultArray = $.parseJSON(result);
  
  
              console.log(result);
              console.log(selectorDiv);
              console.log(divHtml);
              console.log(resultArray);
  
              function(resultArray) {
                var divHtml = '';
                var i;
                for (i = 0; i &lt; arr.length; i++) {
                    divHtml +=  "&lt;div class='element-item honda parts plans class'&gt;&lt;h3 class='name'&gt;" + resultArray[i].product_name + "&lt;/h3&gt;&lt;p class='weight'&gt;&lt;img src='" + resultArray[i].photo + "' width='80' border='0' alt=''&gt;&lt;/p&gt;&lt;/div&gt;"; 
                }
              }
          console.log(divHtml);
          selectorDiv.html(divHtml);
  
  
          },
          error : function(err) {
              console.log('ajax failure');
          }
      });
    }
  }); // end of document ready
  </code></pre>
  
  <p>I'm just not seeing the issue and have been hitting my head against the wall for way too long now.  Any help is gratefully appreciated.</p>