何らかの理由で、jQuery と Javascript が私のサイトで動作しません。
ここを参照してください: http://hellomynameisad.am/test.html
誰かがピークを迎えて、私が欠けているものを教えてもらえますか? jQueryのさまざまなスニッパーを試しましたが、何も機能しないようです。ありがとうございました。
何らかの理由で、jQuery と Javascript が私のサイトで動作しません。
ここを参照してください: http://hellomynameisad.am/test.html
誰かがピークを迎えて、私が欠けているものを教えてもらえますか? jQueryのさまざまなスニッパーを試しましたが、何も機能しないようです。ありがとうございました。
html 要素を javascript にして実行するには、document.ready に配置する必要があります。または、body の終了タグの直前にスクリプトを配置することもできます。
$(document).ready(function(){
$("#container").fadeOut(function() {
$(this).text("World").fadeIn();
});
});
編集:以下のような html の他のいくつかの間違いを見つけました。
HTML を変更する
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.js "> </script>
<title>Untitled Document</title>
<style type="text/css"> </style>
<script type="text/javascript">
$(document).ready(function(){
$("#container").fadeOut(function() {
$(this).text("World").fadeIn();
});
});
</script>
</head>
<body>
<div id="container">Hello</div>
</body>
</html>
これを追加してください
<script>
$(document).ready(function(){
$("#container").fadeOut(function() {
$(this).text("World").fadeIn();
});
});
</script>
コードの一部が</body>
終了し、実行されることを確認します。