views:

36

answers:

3

It ended up being the $(document).ready was missing. Now that I added that the returned html does not seem to want to display. Is there something wrong with the below code?

    success: function(data){
        jQuery('#response').empty();
        var response = jQuery(data).find('#response').html();
        jQuery('#response').hide().html(response).fadeIn();
        jQuery('#loading').remove();
    }
A: 

Is uvhclan.com the same domain of the call? If it is not, you can not make the call because of the Same Origin Policy

If it is the same domain, an error would cause the page to submit and not cancel the submit. Look at the JavaScript console and see if there is an error.

epascarello
+1  A: 

It may be because "#userbar" isn't available in the DOM yet. Is your script nested within a document.ready event? Like this:

jQuery(document).ready(function() {
    var username...
});

Or, the shortcut:

jQuery(function() {
    var username...
});

Or the super shortcut:

$(function() {
    var username...
});
attack
A: 

I fixed it, it was the var response = jQuery(data).find('#response').html(); I was looking for the wrong div.

Steven