使用javascript在span标记中附加文本

时间:2014-07-23 10:32:27

标签: javascript

尝试在一个范围内从javascript编写测试

<span>
    <script  type="text/javascript">document.write("thisStringIsGood".replace(/([A-Z])/g, ' $1').replace(/^./, function(str){ return str.toUpperCase(); }));</script>
</span>

但是firebug显示错误InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable

-----更新的问题-------

<xsl:for-each select="ColumnName">
    <script  type="text/javascript">document.write("thisStringIsGood".replace(/([A-Z])/g, ' $1').replace(/^./, function(str){ return str.toUpperCase(); }));</script>                           
<xsl:apply-templates />
</xsl:for-each>

0 个答案:

没有答案