我正在尝试制作一个显示雅虎图嵌入代码的脚本
嵌入脚本是
<embed bgcolor="#dbdbd3" flashvars="lcId=1169793726234&state=symbol%3D^nsebank;range=1d;indicator=ema(13,34,55)+macd+rsi+stochasticfast;charttype=candlestick;crosshair=on;ohlcvalues=0;logscale=on;source=undefined" loop="false" menu="false" name="BANKNIFTY" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://us.js2.yimg.com/us.yimg.com/i/us/fi/yfc/swf/flashchart_1.18.swf" style="height: 775px; width: 550px" type="application/x-shockwave-flash" wmode="opaque"></embed>
在此脚本中,我希望从下拉菜单列表中获取 state=symbol=^nsebank (^nsebank) 的值,然后在单击计算按钮时显示嵌入代码
我写的代码如下 -
<div id="looknorth"></div>
<script type="text/javascript">
function ln(){
D11=parseFloat(D1.value);
document.getElementById('looknorth').innerHTML='<embed bgcolor="#dbdbd3" flashvars="lcId=1169793726234&state=symbol%3D"+D11+";range=1d;indicator=ema(13,34,55)+macd+rsi+stochasticfast;charttype=candlestick;crosshair=on;ohlcvalues=0;logscale=on;source=undefined" loop="false" menu="false" name="BANKNIFTY" pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://us.js2.yimg.com/us.yimg.com/i/us/fi/yfc/swf/flashchart_1.18.swf" style="height: 775px; width: 550px" type="application/x-shockwave-flash" wmode="opaque"></embed>';} </script>
<table border=1 cellpadding=2 cellspacing=1 width="400">
<tr>
<td style="background-color:#123742; font-size:12 ; font-weight:bold">
<font color="#FFFFFF">Compounding</font>
<td> <br />
<select name="D1">
<option value="^nsei">Annually</option>
<option value="^bsen">Half Yearly</option>
</select>
<tr>
<td colspan="2" ALIGN="center">
<input type=button style="background-color:#123742; color:#FFFFFF; font-weight:bold; font-size:15" name=calculate value=Calculate onClick=ln();>
</table>
该脚本不起作用,请帮助我修复错误。