Мой HTML-файл:
<script>
$(document).ready(function() {
$.ajax({
type: "POST",
url: "search.php",
data: "id=1",
datatype: "json",
success: function(msg){
$('.result1').html(msg["name"]);
}
});
})
</script>
<span class="result1"></span>
Мой php файл:
<?
$a["name"] = 'john';
echo json_encode($a);
?>
Почему имя Джон не появляется в классе result1? Зачем? Пожалуйста, помогите мне, я схожу с ума.
edit: Можно ли сделать щедрость прямо сейчас?