2012-10-22 32 views
0
var img = '<textarea cols="60" id=' + div_id + ' name=handle[' + required_name + '] rows="7">'; 
img = img + '<div id="fullscreen-button-'+id+'" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen('+'"'+path+'"'+')"></div>'; 
img = img + '<embed src=' + path + ' width="" height="" />'; 
img = img + '</textarea>'; 

======================================= =====如何调用javascript变量

输出来为

<div id="fullscreen-button-0" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen(" upload microsite micro_1 calcsmall.swf')'></div> 

onclick="fullscreen(" upload microsite micro_1 calcsmall.swf')' 

我想

onclick="fullscreen('upload/microsite/micro_1/calcsmall.swf')"

+0

可以粘贴什么呢路径变量包含反正perhap那么我们就可以帮助 – Viren

+0

路径=上传/微型/ micro_1/calcsmall.swf –

+0

其实我用这一切的JavaScript代码。没有使用铁轨。 –

回答

1
img = img + '<div id="fullscreen-button-'+id+'" style="position:relative;left:220px;width:24px;height:24px;cursor:pointer;background-image:url(../assets/resize_full.png);" onclick="fullscreen(\''+path+'\')"></div>'; 
+0

不工作相同的问题。 :( –

相关问题