tonelm54
asked on
First Ajax jQuery example
Ive been trying to get my first ajax jQuery code working and about to give up. I cannot figure out what it wrong, and it doesnt seem to be pussing any errors.
The code I think is quite simple, that is pull in the file test.html and stick the contents into the div with the ID 'result', however it doenst ever seem to fire.
Any ideas what Im doing wrong :-S
The code I think is quite simple, that is pull in the file test.html and stick the contents into the div with the ID 'result', however it doenst ever seem to fire.
<head>
<title></title>
<script type="text/javascript" src="..\jquery-1.6.4.js"></script>
<script type="text/javascript">
$(".trigger").click(function() {
$.ajax({
type: 'GET',
url: 'test.htm',
dataType: 'html',
sucess: function(html, textStatus) {
$(".result").append(html);
},
error: function (xhr, textStatus, errorThrown) {
$(".error").append(errorThrown ? errorThrown : xhr.status);
}
})
});
</script>
</head>
<body>
<div id="trigger">Trigger</div>
<div id="result"></div>
<div id="error"></div>
</body>
</html>
Any ideas what Im doing wrong :-S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent, thank you for you help :-)
ASKER
Open in new window
Any ideas?