I'm wondering if anyone can see what I am doing wrong?
It's been a little while since I last used jquery so I think I'm missing something fairly simple.
I'm using the onchange event of an HTML select element to fire an ajax call with the intention of
replacing the contents of a div element elsewhere in the page.
However, the .html(data) call is having no effect on the div (nor is .remove() when testing that). Here is the code so far:
Firefox/Firebug is showing the ajax call firing and returning the expected HTML.
Can anyone see where I am going wrong?
HTML ELEMENT TO CHANGE
<div class="content-to-change">
<tr>
<td>data1</td>
<td>data2</td>
</tr>
</div>
JQUERY CODE
<script type="text/javascript">
<!--
function simple_request() {
// enable calling of jquery using 'jquery' instead of '$'
jQuery.noConflict();
alert(jQuery("div.content-to-change").size()); // sanity check, returns 1
jQuery.get('/path/file.htm'), function(data) {
jQuery('div.content-to-change').html(data); // has no effect
alert('Load was performed' + data); // this alert is displayed with the data
});
}
//-->
</script>