innerHTML的乙個奇怪問題

2021-08-22 04:10:55 字數 633 閱讀 4369

背景:使用ajax翻頁

起初**是這樣的:

頁面:<#include "/cn/videoplay/comment/listcomment.ftl">

ajax:

$('comment).innerhtml = originalrequest.responsetext;

在firefox下是好的,在ie下頁面會掛在那不動,經檢測ajax請求和相應都沒問題,執行$('comment).innerhtml = originalrequest.responsetext;就出了問題。

搞了半天也沒搞出個所以然,無奈之下採用如下策略

頁面:<#include "/cn/videoplay/comment/listcomment.ftl">

ajax:

$('commentx').innerhtml = originalrequest.responsetext;

問題解決了,但為什麼會這樣還是不知道,僅僅知道中的comment在css檔案中定義了,難道css定義了id,執行$('comment).innerhtml = originalrequest.responsetext;就會出錯?其實originalrequest.responsetext為很簡單的字串時不會出錯,但一旦稍微複雜一點就會有問題.

innerHTML的乙個奇怪問題

背景 使用ajax翻頁 起初 是這樣的 頁面 include cn videoplay comment listcomment.ftl ajax comment innerhtml originalrequest.responsetext 在firefox下是好的,在ie下頁面會掛在那不動,經檢測a...

spring mvc dwr 1的乙個奇怪的問題

最近在搞的乙個應用,用spring 1的mvc hibernate 3 dwr1的,結果發現個奇怪的問題.其中用dwr1的地方也就是 在使用者註冊的時候,判斷這個使用者是否存在,這個用dwr1去做的,如下 dwr的配置 com.mysql.jdbc.driver jdbc mysql localho...

乙個奇怪的listview

一般情況下listview就是乙個頭有控制代碼 用spy看看任務管理器 就是 程序 這個有個控制代碼 就知道了 再就是整個listview乙個控制代碼 一共2個控制代碼 分別是 主控制代碼 syslistview32 和頭控制代碼 sysheader32 這個奇怪的listview被分成了3個控制代...