股票即时行情查询系统
作者:cmscn 日期:2008-04-24
<head>
<tiltle>【 中国MACD股市技术分析俱乐部 】-www.cnmacd.com-股票即时行情查询系统 </title>
</head>
<script language="javascript">
var currentStockCode = "";
var stockListDisplay = false;
function linkToStockView(stockCode){
currentStockCode = stockCode;
var kimageurl = "http://stockimg.sina.com.cn/newchart/daily/"+stockCode+".gif";
var priceurl = "http://fchart.sina.com.cn/newchart/min/"+stockCode+".gif";
window.kimageframe.location.href = kimageurl;
window.priceframe.location.href = priceurl;
linksina.style.display = "inline";
window.scroll(0, 0);
}
function queryStock(stockCode){
//var stockCode = stock_code.value;
if(stockCode==""){
alert("输入的股票代码为空!");
return;
}
var codePref = stockCode.substring(0,1);
if(codePref=="0"){ //深市
stockCode = "sz"+stockCode;
linkToStockView(stockCode);
}else if(codePref=="6"){ //沪市
stockCode = "sh"+stockCode;
linkToStockView(stockCode);
}else{
alert("请输入正确的股票代码!");
}
}
function linkSina(){
var linkurl = "";
if(currentStockCode!=""){
linkurl = "http://finance.sina.com.cn/realstock/company/"+currentStockCode+"/kline.shtml?daily";
window.open(linkurl);
}else{
alert("系统不能确定查询的股票!");
}
}
function displayStockList(){
if(stockListDisplay){
stocklist.style.display="none"
stockListDisplay = false;
}else{
stocklist.style.display="inline"
stockListDisplay = true;
}
}
</script>
<table>
<tr><td> </td></tr>
</table>
<table id="querystock" border="0" cellpadding="0" cellspacing="0">
<tr >
<td>沪深A股代码 <input type="text" name="stock_code" value="" size="10">  </td>
<td><input type="button" name="query_button" value="查询" onClick="queryStock(stock_code.value)"> </td>
</tr>
</table>
<table id="stockview" border="0" cellpadding="0" cellspacing="0" >
<tr >
<td width="100%">----------------------------------------------------------</td>
</tr>
<tr >
<td width="50%">
<iframe id="kimageframe" align="left" frameborder="0" scrolling="no" width="500px" height="300px;">
</iframe>
</td>
<td width="50%">
<iframe id="priceframe" align="left" frameborder="0" scrolling="no" width="500px" height="300px;"></iframe>
</td>
</tr>
</table>
<table id = "linksina" style="display:none">
<tr>
<td width="30%"> </td>
<td width="40%" align="center" >
<input type="button" name="urlbutton" value="详细行情>>" onClick="linkSina()"> </td>
<td width="30%"> </td>
</tr>
</table>
<table>
<tr>
<td> </td>
</tr>
<tr>
<td><input name="stocklisttiltle" type="button" value="部分股票列表" onClick="displayStockList()"></td>
</tr>
<tr>
<td>----------------------------------------------------------</td>
</tr>
</table>
<!-- 可以按下面的格式添加自己需要的股票,也可以删除其中不需要的 -->
<table id="stocklist" border="1" style="display:none" >
<tr><td onClick="queryStock('600037')">G歌华 600037</td></tr>
<tr><td onClick="queryStock('600036')">G招行 600036 </td></tr>
<tr><td onClick="queryStock('600016')">G民生(上海,600016)</td></tr>
<tr><td onClick="queryStock('600138')">G中青旅 600138 </td></tr>
<tr><td onClick="queryStock('600258')">首旅股份(上海,600258)</td></tr>
<tr><td onClick="queryStock('000912')">G泸天化(深圳,000912)</td></tr>
<tr><td onClick="queryStock('600528')">G中铁(上海,600528)</td></tr>
<tr><td onClick="queryStock('000568')">G老窖(深圳,000568)</td></tr>
<tr><td onClick="queryStock('600663')">G陆家嘴(上海,600663)</td></tr>
<tr><td onClick="queryStock('600007')">中国国贸(上海,600007)</td></tr>
</table>
http://www.im286.com/viewthread.php?tid=1930017
评论: 0 | 引用: 0 | 查看次数: 561
发表评论