我買了一個WordPress主題,我有幾個錯誤,希望能解決我與主題的jQuery和AJAX的BuddyPress衝突。Uncaught TypeError:無法調用方法'getElementsByTagName'null
我的問題是我得到2個錯誤:
Uncaught TypeError: Cannot call method 'getElementsByTagName' of null
init:function(tabid, dselected){ var menuitems=document.getElementById(tabid).getElementsByTagName("a")
Error: Uncaught TypeError: Cannot call method 'getElementsByTagName' of null (repeated 2 times)
Uncaught TypeError: Cannot call method 'getElementsByTagName' of null
buildcontentdivs:function(setting){ var alldivs=document.getElementById(setting.id).getElementsByTagName("div")
Error: Uncaught TypeError: Cannot call method 'getElementsByTagName' of null
我不知道如何解決這個問題,因爲我不是一個程序員。我只知道HTML,CSS和基本的WordPress PHP。
等待,您*有*訪問jQuery? –
該錯誤告訴您各個元素不存在於瀏覽器文檔的DOM節點中。由於服務器端的問題,有可能在沒有web文檔存在或者缺少服務器發送的html內容的情況下執行javascript。 –