<div class="content" id="current">
<div id="loader" style="display:none;"><img src="/images/loader.gif" alt="" /></div>
</div>
I have a Box element in the code above, and when I click on a submit button, I want a loader image to appear. After receiving a response back, I want the image in the response to fade in.
However, when I click submit, I do not see the loader and the image does not replace the content in #current.
$('#Submit').click(function (e) {
$('#error').html("");
e.preventDefault();
code = $('#Code').val(),
$('#loader').show();
$.post('/home/foo/', { code: code },
function (data) {
$('#loader').hide();
alert(currentItem.ItemImage);
$('#current').html(currentItem.ItemImage);
How can I correct this issue?
What mistakes am I making in my code?