innerHTML问题 [英] innerHTML problem

查看:96
本文介绍了innerHTML问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对innerHTML有问题

i获取tr的innerHTML的值并修改文本

但是当我尝试将此文本放回innerHTML时它表示未知的运行时错误

即时尝试在onclick url中附加一些参数


[HTML]< table bgcolor =" #FFFFFF"宽度= QUOT; 150"边界=" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0">

< tr id =" xyz">

< td height =" 150"风格= QUOT;光标:指针; cursor:hand; onClick =" popup = window.open(''http://example.com/abc.html?xyz=aa&abc=ssdfd'',_blank'',''height=450,wid th = 500,滚动条= yes,resizable = yes,toolbar = yes,me nubar = yes,status = 1,location = yes'');这里返回false">一些代码

< / td>

< / tr>

< / table> [/ HTML ]

i have problem with innerHTML
i get the value of innerHTML of tr and modify the text
but when i try to put this text back in innerHTML it says unknown runtime error
im trying to append some paramaeter in the onclick url

[HTML]<table bgcolor= "#FFFFFF" width="150" border="0" cellpadding="0" cellspacing="0">
<tr id="xyz">
<td height="150" style="cursor:pointer; cursor: hand;" onClick="popup = window.open (''http://example.com/abc.html?xyz=aa&abc=ssdfd'',_blank'',''height=450,wid th=500,scrollbars=yes,resizable=yes,toolbar=yes,me nubar=yes,status=1,location=yes''); return false">some code here
</td>
</tr>
</table>[/HTML]

展开 | 选择 | Wrap | 行号

推荐答案

你还没有定义x在第5行。
You''ve not defined "x" on line 5.


x在上面的某个代码中,在window.onload
x is in a code somewhere above before window.onload


temp.indexOf("''")之前在线5是找到第一个单引号而不是第二个引号,因此额外的参数被添加到开头,这会导致语法错误。
temp.indexOf("''") on line 5 is finding the first single quote rather than the second one, so the extra parameter is added to the beginning which causes a syntax error.


这篇关于innerHTML问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆