$('#a'+i).html(code);
$('#b'+i).html(name);
if(curr_f > yest_f) ...{
$('#c'+i).html("" + curr_f + "");
} else if(curr_f < yest_f) ...{
$('#c'+i).html("" + curr_f + "");
} else ...{
$('#c'+i).html(curr_f);
}
$('#d'+i).html(tday_f);
$('#e'+i).html(yest_f);
if(temp_f > 0) ...{
$('#f'+i).html("" + temp_f.toFixed(2) + "");
$('#g'+i).html("" + ((temp_f / yest_f) * 100).toFixed(2) + " % ");
} else if(temp_f < 0) ...{
$('#f'+i).html("" + temp_f.toFixed(2) + "");
$('#g'+i).html("" + ((temp_f / yest_f) * 100).toFixed(2) + " % ");
} else ...{
$('#f'+i).html(temp_f.toFixed(2));
$('#g'+i).html(((temp_f / yest_f) * 100).toFixed(2) + " % ");
}
$('#h'+i).html(temp3.split(',')[4]);
$('#i'+i).html(temp3.split(',')[5]);
}
}
});
}
$(document).ready(function()...{
var stocks = $("#stockinit").val().split(','); $("#insrow").click(function()...{ var stockcd = $("#stockid").val(); $("#delrow").click(function()...{ window.setInterval("ajaxRequest()",3000); function addRows()...{
for(var i=0; i
}
if(stockcd == "")...{
alert("股票代号不能为空!");
$("#stockid").focus();
return;
}
if(stockcd.length != 6)...{
alert("股票代号只能是6位!");
$("#stockid").focus();
return;
}
var div = 'sh';
if(document.getElementById("sz_id").checked)...{ div = "sz";}
var stocks = $("#stockinit").val();
$("#stockinit").val(stocks + "," + div + stockcd);
addRows();
});
var table = document.getElementById("tableId");
var index = table.rows.length;
if (index < 2)...{
alert("已经没有可删除的行了!");
} else ...{
table.deleteRow(index - 1);
var stockvalue = $("#stockinit").val();
var count = stockvalue.split(',').length;
if(count == 1) ...{
stockvalue = "";
} else ...{
stockvalue = stockvalue.substr(0, stockvalue.length - 9);
}
$("#stockinit").val(stockvalue);
}
});
});
var table = document.getElementById("tableId");
var index = table.rows.length;
var str="";
var row = index - 1;
str+='' ';
str+=''
str+=''
str+=''
str+=''
str+=''
str+=''
str+=''
str+=''
str+=''
str+='
$("#tablebody").append(str);
}
script>