<script> //FOR/IN循环.当使用for/in循环遍历关联数组时,就可以清晰地体会到for/in的强大之处. function getvalue(portfolio){ var total=2.0; for(stock in portfolio){ //遍历portfolio中的每只股票 var shares=portfolio[stock]; //得到每只股票的份额 var proce=getQuery(stock); //查找股票价格 getQuery()查询部分 total+…
var dataList=[]; var stock0={stockcode:"007758",stockname:"商业政7",state:"1"}; var stock1={stockcode:"006658",stockname:"材料政8",state:"1"}; var stock2={stockcode:"023758",stockname:"深…