title: javascript : function parameters passing?
body: <p>My code is as follows:</p>
  
  <p>The "data" is:</p>
  
  <p>[{"DESCRIPTION":"sf","Name":"Tom","Date":"2014-07-08 10:19:29.0","PICTURES":[]},{"DESCRIPTION":"sf","Name":"Tom","Date":"2014-07-08 10:23:33.0","PICTURES":[]},{"DESCRIPTION":"dfs","Name":"Tom","Date":"2014-07-08 10:27:20.0","PICTURES":[]},{"DESCRIPTION":"sfd","Name":"Tom","Date":"2014-07-08 10:31:35.0","PICTURES":[{"PICTURE":"C:\Users\hanlu Feng\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\ServletHtml\pictures\Tom\2014-07-08-10-31-35\2012042622442667.jpg"},{"PICTURE":"C:\Users\hanlu Feng\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\ServletHtml\pictures\Tom\2014-07-08-10-31-35\833344_1071288421.jpg"}]}]</p>
  
  <pre><code>//Code 1 
  
  function dynamicReport(data){
      var table = document.getElementById("erroreport");
      if(table.rows.length==0){
          for(var i=0;i&lt;=data.length;i++){
              if(i==0){
              var row = table.insertRow(0);
              var cell = row.insertCell(0);
              cell.innerHTML = titleName;
              cell = row.insertCell(1);
              cell.innerHTML = titleTime;
              cell = row.insertCell(2);
              cell.innerHTML = titleDescription;
              cell = row.insertCell(3);
              cell.innerHTML = titleImages;
              }else{
                  var row = table.insertRow(i);
                  var cell = row.insertCell(0);
                  cell.innerHTML= data[i-1].Name;
                  cell = row.insertCell(1);
                  cell.innerHTML = data[i-1].Date;
                  var description = data[i-1].DESCRIPTION;
                  if(description.length&gt;7){
                      description = description.substring(0,7)+"..."
                  }
                  cell = row.insertCell(2);
                  cell.innerHTML=description;
                  var userName = data[i-1].Name;
                  var reportTime= data[i-1].Date;
                  var url = "selectionShow";
                  var p ="&lt;p&gt;&lt;u&gt;&lt;font  size='2' color='blue' onclick='requestPictures("+url+"," +userName+", "+reportTime+")' style='cursor:pointer'&gt;Check Pcitures&lt;/font&gt;&lt;/u&gt;&lt;/p&gt;";
                  cell = row.insertCell(3);
                  cell.innerHTML = p;
              }//end else
  
          }//end for
      }//end if
  }
  
      // code 2
  
  function requestPictures(listUrl,name,time){
      var var1=name;
      var var2 = time;
      $.ajax({
          cache : false,
          type : "POST",
          dataType : "json",
          url : listUrl,
          //data : $("#ajaxFrm").serialize(), 
          data : {command:"images","name":name,"time":time},
          async : false,
          error : function(request) {
              waidAni();
              if(request.status ==202){
                  alert(request.responseText);
              }else
              alert("Request Error");
          },
          success : function(data) {
              waidAni();          
              //alert(data);
              window.location.href= data;
  
  
  
          }
      });
  
  }
  </code></pre>
  
  <p>When I debug it ,there is a error "Uncaught SyntaxError: Unexpected number ".
  I think the error is in the code:</p>
  
  <pre><code>var p ="&lt;p&gt;&lt;u&gt;&lt;font  size='2' color='blue' onclick='requestPictures("+url+"," +userName+", "+reportTime+")' style='cursor:pointer'&gt;Check Pcitures&lt;/font&gt;&lt;/u&gt;&lt;/p&gt;";
  </code></pre>
  
  <p>I tried many methods ,it doesn't work. And I use the method in this link:
  <a href="https://i.stack.imgur.com/24QmE.png" rel="nofollow noreferrer">parameters passing</a></p>
  
  <p>The error still exists.I don't know why?</p>
  
  <p>I want to create a table just like this:
  <img src="https://i.stack.imgur.com/24QmE.png" alt="enter image description here"></p>