English 中文(简体)
单击将显示的嵌入对象中添加变量
原标题:add variable in embeded object to be displayed onclick

我有一个嵌入的代码 whhich 正在跳出, 当我单击计算按钮时显示

<script type="text/javascript">
function ln(){
document.getElementById( looknorth ).innerHTML= <embed bgcolor="#dbdbd3" flashvars="lcId=1169793726234&amp;state=symbol%3D%5Ensebank;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>
<input type=button style="background-color:#123742; color:#FFFFFF ; font-weight:bold; font-size:15" name=Button2 value=Calculate onClick=ln();></td></tr>

我想有一个缓存菜单, 它从下拉菜单的值中取出符号“ 符号% 3D% 5Ensebank; ” 的值 。

i 添加代码

<select size="1" name="D1">
<option value="nsei" selected>Nifty</option>
<option value="bsen">Sensex</option>
</select><input type="submit" value="Submit" name="B1" onClick=ln();></p>

但是在嵌入代码中要做出什么修改才能从 D1 中取取符号值

请帮助您帮助

<div id="looknorth"></div>
<script type="text/javascript">
function ln(vidvar){

tempcell = document.createElement("embed");
tempcell.setAttribute("bgcolor","#dbdbd3");
tempcell.setAttribute("flashvars",
("lcId=1169793726234&amp;state=symbol="
+vidvar+
";range=1d;indicator=ema(13,34,55)+macd+rsi+stochasticfast;charttype=candlestick;crosshair=on;ohlcvalues=0;logscale=on;source=undefined")
);
tempcell.setAttribute("loop","false");
tempcell.setAttribute("menu","false");
tempcell.setAttribute("name","Bank Nifty");
tempcell.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");
tempcell.setAttribute("src","http://us.js2.yimg.com/us.yimg.com/i/us/fi/yfc/swf/flashchart_1.18.swf");
tempcell.setAttribute("style","height: 775px; width: 550px");
tempcell.setAttribute("type","application/x-shockwave-flash");
tempcell.setAttribute("wmode","opaque");


document.getElementById( looknorth ).innerHTML=""
document.getElementById( looknorth ).appendChild(tempcell);

}

<form name="Video" id="search" onsubmit="ln(search.D1.value)">

<select size="1" name="D1">
<option value="^nsei" selected>Nifty</option>
<option value="^bsesn" >Sensex</option>
</select>

<input type="submit" value="Submit" name="B1" onClick=ln();>

i tried to de-bug the code but still is not working. 请帮助您帮助

问题回答

您需要将其附加在表格标签中 。

<form name="Video" id="search" onsubmit="ln(search.D1.value)">

<select size="1" name="D1">
<option value="nsei" selected>Nifty</option>
<option value="bsen" >Sensex</option>
</select>

<input type="submit" value="Submit" name="B1" />

</Form>

然后,更改( ), 这样它需要一个变量, 所以也许尝试一下 :

<script type="text/javascript">
function ln(vidvar){

tempcell = document.createElement("embed");
tempcell.setAttribute("bgcolor","#dbdbd3");
tempcell.setAttribute("flashvars",
    ("lcId=1169793726234&amp;state="
    +vidvar+
    ";range=1d;indicator=ema(13,34,55)+macd+rsi+stochasticfast;charttype=candlestick;crosshair=on;ohlcvalues=0;logscale=on;source=undefined")
    );
<!-- And  so on for the rest of the attributes of the <embed> tag -->   
document.getElementById( looknorth ).innerHTML=""
document.getElementById( looknorth ).appendChild(tempcell);
  }     
</script>

可能这里有窃听器,但这是一般的想法。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签