日期:2014-05-16  浏览次数:20401 次

请高手看下 我这段JS哪错了?
$(document).ready(function(){
  init(dataArray);
  $("#d11").datepicker({
});
  $("#d12").datepicker({
});

  $("#orderquery").bind("click",researchEvent);
 });
function researchEvent(){

var startime = $("#d11").attr("value");
var endtime = $("#d12").attr("value");
var param = {"startime":startime,"endtime":endtime,"order_id":order_id,"goodsname":goodsname,"act":"orderquery"};
  $.ajax({
 
type:"get",
url:"queryorder_do.jsp",
data:param,
dataType:"json",
success:function(s){
if(typeof(s)!="undefined"){
alert("查询成功!");
clearTable();
init(s);

}else{
alert("查询失败!");

}

}
})
}
function init(array){
  var tableObj = document.getElementById("table");
  var tr_title = tableObj.insertRow(0);
  tr_title.width="1000";
  tr_title.height="18";
  tr_title.align = "center";
  var td_title_order_id = tr_title.insertCell(0);
  td_title_order_id.width="100";
  td_title_order_id.height="18";
  td_title_order_id.innerHTML="订单编号";
  var td_createtime = tr_title.insertCell(1);
  td_title_createtime.width="100";
  td_title_createtime.height="18";
  td_title_createtime.innerHTML = "下单时间";
  var td_goosname = tr_title.insertCell(2);
  td_title_goodsname.width = "100";
  td_title_goodsname.height = "18";
  td_title_goodsname.innerHTML = "商品名称";
  var td_unitprice = tr_title.innsertCell(3);
  td_title_unitprice.width = "100";
  td_title_unitprice.height = "18";
  td_title_unitprice.innerHTML = "原价";
  var td_trade_price = tr_title.innsertCell(4);
  td_title_trade_price.width = "100";
  td_title_trade_price.height ="18";
  td_title_trade_price.innerHTML = "现价";
  var td_user_grade = tr_title.innsertCell(5);
  td_title_user_grade.width ="100";
  td_title_user_grade.height="18";
  td_title_user_grade.innerHTML = "买家等级";
  var td_issend =tr_title.innsertCell(6);
  td_title_issend.width ="100";
  td_title_issend.height ="18";
  td_title_issend.innerHTML = "发货状态";
  var td_shopping_number = tr_title.innsertCell(7);
  td_title_shopping_number.width ="100";
  td_title_shopping_number.height="18";
  td_title_shopping_number.innerHTML="商品数量";
  var td_totalprice = tr_title.innsertCell(8);
  td_title_totalprice.width ="100";
  td_title_totalprice.height="18";
  td_title_totalprice.innerHTML="原价合计";
  var td_trade_total = tr_title.innsertCell(9);
  td_title_trade_total.width = "100";
  td_title_trade_total.height = "18";
  td_title_trade_total.innerHTML ="现价合计";
 
 
  for(var i=0;i<array.length;i++){