蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程


    

蓝森林 http://www.lslnet.com 2006年8月25日 8:28

JS:怎么运行代码中有"?"?

runcode函数:

function runCode(obj) {
        var winname = window.open('', "_blank", '');
        winname.document.open('text/html', 'replace');
        winname.document.writeln(obj.value);
        winname.document.close();
}

当需要运行的代码中还有 时,runCode()后再查看源代码发现 已变成问号,请问怎么解决?

例如需要运行的代码:

&lt;table width=&quot;100%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; id=&quot;PowerTable&quot;&gt;<br />
&lt;tr align=&quot;center&quot; bgcolor=&quot;#FFCC00&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;First Name&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;Last Name&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;Team&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;Engine&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;Tyres&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;Fastest Lap&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;国家&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />

顶下




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com