I have a jQuery function that I am calling on a click event. The code snippet is below
$.ajax({
url: '/delivery_windows/' + current_month + '/' + selected_day,
success: function(data) {
$('#time-selection').html(data);
}
});
Above this snippet in the actual file, current_month and selected_day are being set. I have added an alert(data) function within the success function and the proper html shows in the alert box, but the time-selection element displays completely empty on the web page.
I have tested in Firefox, Chrome, Safari, and Opera. All of these work as expected. IE 7 and IE 8 are the only ones that return an empty time-selection element.
I have read on other posts to try calling .empty() on time-selection and then call .append() instead of using .html(), but I get the same results.
Does anyone have an idea of what I am doing wrong with this?
Any help would be greatly appreciated!
I am building this in Drupal in case that makes a difference, with jQuery 1.3.2
Thanks in advance!!
datalook like?$('#time-selection').html('foo');work? If not, this has nothing to do with your AJAX call and everything to do with the markup already on the page. Either the selector is invalid (maybe a bit TOO obvious), or something else is wonky with the HTML (e.g., an unclosed tag).