title: Could not convert javascript argument
body: <p>After trying to append some code to a div layer I received the following error and don't know why.</p>
  
  <blockquote>
    <p>uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMDocumentFragment.appendChild]" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame :: <a href="http://code.jquery.com/jquery-latest.min.js" rel="noreferrer">http://code.jquery.com/jquery-latest.min.js</a> :: anonymous :: line 113" data: no]</p>
  </blockquote>
  
  <p>Below is the code that is causing the error. I understand there is some excessive code but I made it that way so it would be easy to build on for future features.  Just looking for any suggestions for the error? Thank You! :)</p>
  
  <pre><code> function catSelect(itm){ 
  
    //params for query
    var params = { 
     category: itm
    };
  
    var cmd = jQuery.param(params);
  
    $.ajax({
     async: false,
     type: "POST",
     cache: false,
     url: "views/gallery.php",
     data: cmd,
     dataType: "json",
     success: function(resp){
      if(resp.status == "ok") {
       $('#project').empty();
       //alert(resp.projects[0]);alert(resp.files[0]); alert(resp.titles[0]);
       var check = 0;
       var projGallery = new Array();
       for(var i in resp.projects){
        if(check!=resp.projects[i] || check == 0){
         projGallery[i] ='&lt;a class="group" title="'+resp.titles[i]+'" href="images/gallery/"'+resp.files[i]+'" rel="'+resp.projects[i]+'" &gt;&lt;img class="group" alt="" src="../images/gallery/thumbs/"'+resp.files[i]+'"/&gt;&lt;/a&gt;';  
        } else {
         projGallery[i] ='&lt;a class="group" rel="'+resp.projects[i]+'" href="images/gallery/"'+resp.files[i]+'" title="'+resp.titles[i]+'"&gt;&lt;/a&gt;';
        }
        check = resp.projects[i];
       }
       //alert(projGallery[0]);
       alert(projGallery);
       $('#project').append(projGallery);
      } else {
       alert("Failed to select projects");
      }
     }
    }); 
   }
  </code></pre>
  
  <p></p>