Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jQuery で問題が発生しています。
null のメソッド 'html' を呼び出すことはできません
コード:
var currenthtml = $('div.welcome').html(); var newhtml = ' Mod Loaded'; var totalhtml = currenthtml+' '+newhtml; $('div.welcome').html(totalhtml);
最初にロードしようとすると失敗し、2 回目にロードすると機能します。
チェックしてください、
jquery コードが$(document).ready(function()JQuery の関数内に記述されているかどうか。
$(document).ready(function()
また、HTML の最後に JQuery コードを記述してみてください。
あなたの問題を見てきたように、JQuery コードが初めて実行されるときに、HTML DOM がその'div.welcome'部分を取得していないことを理解しています。
'div.welcome'
これがお役に立てば幸いです。
ありがとう。