Cloud9IDEを使用しています。私の目標は、JQueryAJAXを使用するアプリケーションを開発できるようにすることです。
私はこれらの2つのファイルを持っています:
- test.htm
<p class="result">the result</p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>
$.get('test.php', function(data) {
$('.result').html(data);
alert('Load was performed.');
});
</script>
`2。test.php
<?php
echo "hello world";
?>
問題は、クラス「result」のパラガーフが「helloworld」と表示される必要があることです。代わりに、phpファイルの内容全体が追加されています。
phpファイルに「helloworld」を期待どおりにエコーさせるにはどうすればよいですか?