I have a javascript function making a AJAX get request and the callback setup to update the content of a div. The only problem is that within the callback function I get the error Uncaught TypeError: Object #HTMLDivElement has no method ‘html’
For some reason the jquery $(“selector”) is returning just the div not a jquery object.
Here’s the code
//HTML
<select id="dimensions" name="dimensions" onchange="getDimention()">
<option value="default">Select One</option>
....
</select>
<div id="dim" > No Dimentions added yet</div>
//JS
function getDimention() {
var eSelect = document.getElementById('dimensions');
server.Dimention(eSelect.value, onGetDimentionSuccess); //make AJAX call
}
function onGetDimentionSuccess(response) {
$('dim').html(response);
}
Do you have prototype or any other javascript framework running?
Try jQuery.noConflict() and then using jQuery(‘#dim’).html