点击图片查看详细数据
分析师:产业链上下游并购更受欢迎
河北钢铁 (SZ:000709) 最新价:3.78 0.03 0.79%
var code_map = Array(); var code_type_map = Array(); var getHQ = function(str) { var code_str = ''; var arr = str.split(','); for (var i in arr) { var temp_arr = arr[i].split(':'); var code = temp_arr[0]; var name = temp_arr[1]; var type = temp_arr[2]; code_str += code + ','; code_map[code] = name; code_type_map[code] = type; } code_str = code_str.substr(0, code_str.length-1); //通过单纯js实现 var requestURL = 'http://hq.finance.ifeng.com/q.php?l='+code_str+'&f=json&e=show();'; var objHead = document.getElementsByTagName('head'); var objScript = document.createElement('script'); objScript.type = 'text/javascript'; objScript.src = requestURL; objHead[0].appendChild(objScript); }; var show = function() { var str = ''; var n = 0; for(var code in json_q) { var last = (json_q[code][0] == undefined) ? '--' : json_q[code][0].toFixed(2); var chg = (json_q[code][2] == undefined) ? '' : json_q[code][2].toFixed(2); var chg_pct = (json_q[code][3] == undefined) ? '' : json_q[code][3].toFixed(2); var fullcode; var pic_state = ''; var code2 = ''; var color_cls = ''; if (chg_pct > 0) { color_cls = 'class="up"'; pic_state = ''; } else if (chg_pct < 0) { color_cls = 'class="down"'; pic_state = '不锈钢非标定制 ,河北钢铁疾进" src="http://img.ifeng.com/tres/finance/deco/2009/0727/icon_down.gif" />
'; } else { pic_state = '-'; } if (chg == '') { chg = '0'; } else if (chg == undefined) { chg = '--'; } else { chg = Math.abs(chg); } if (chg_pct == '') { chg_pct = '0'; } else if (chg_pct == undefined) { chg_pct = '--'; } else { chg_pct = Math.abs(chg_pct)+'%'; } var code_prefix = ""; str += ''; switch (code_type_map[code]) { case 'stock': //股票 code_prefix = ""; fullcode = code.replace('s_', ''); if (fullcode.indexOf('sh') != -1) { code_prefix = 'SH:'; } else if (fullcode.indexOf('sz') != -1) { code_prefix = 'SZ:'; } code2 = fullcode.replace('sh', ''); code2 = code2.replace('sz', ''); str += ' '+code_map[code]+' ('+code_prefix+code2+')'; str += ' 最新价:'+last+' '+pic_state+' '+chg+' '+chg_pct+''; str += ' '; str += ' '; str += ' '; break; case 'fund': //基金 if (code.indexOf('of') != -1) {//开放式 fullcode = code.replace('snv_', ''); code2 = fullcode.replace('of', ''); str += ' '+code_map[code]+' ('+code2+')'; str += ' 最新价:'+last+' '+pic_state+' '+chg+' '+chg_pct+''; str += ' '; str += ' '; } else {//封闭式 fullcode = code.replace('s_', ''); code2 = fullcode.replace('sh', ''); code2 = code2.replace('sz', ''); str += ' '+code_map[code]+' ('+code2+')'; str += ' 最新价:'+last+' '+pic_state+' '+chg+' '+chg_pct+''; str += ' '; str += ' '; } break; case 'hkstock': //港股 code_prefix = ""; fullcode = code.replace('s_', ''); code2 = fullcode.replace('hk',''); if (fullcode.indexOf('hk') != -1) { code_prefix = 'HK:'; } str += ' '+code_map[code]+' ('+code_prefix+code2+')'; str += ' 最新价:'+last+' '+pic_state+' '+chg+' '+chg_pct+''; str += ' '; break; case 'bond': //债券 fullcode = code.replace('s_', ''); code2 = fullcode.replace('sh', ''); code2 = code2.replace('sz', ''); str += ' '+code_map[code]+' ('+code2+')'; str += ' 最新价:'+last+' '+pic_state+' '+chg+' '+chg_pct+''; str += ' '; break; case 'stock_index': //股指 fullcode = code.replace('s_', ''); code2 = fullcode.replace('sh', ''); code2 = code2.replace('sz', ''); str += ' '+code_map[code]+' ('+code2+')'; str += ' 最新价:'+last+' '+pic_state+' '+chg+' '+chg_pct+''; str += ' '; break; case 'int': //国际股指 break; case 'option': //权证 break; case 'futures': //期货 break; } str += '