I am using jQuery to make an AJAX call. The call is procesed and returns data as expected, but when I use `$("#newsLetterForm").html(data);` the link address pops OUT of the `` tags.
**The Ajax Request**
$.ajax({
async: true,
data: $dataToSend,
datatype: 'html',
beforeSend: function() {
$('#newsletterForm').html('
');
},
error: function(jqXHR, textStatus) {
$('#newsletterForm').html("Error: " + textStatus);
},
success: function(data, textstatus, jqXHR) {
$('#newsletterForm').html(data);
},
timeout: 3000,
type: 'POST',
url: 'http://myurl.com',
});
**Alert Return Data** - notice Support is in the tags
There was an error processing your request. Please send your request to
Support
**Output to Browser** - notice that Support is *outside* of the tags
There was an error processing your request. Please send your request to
Support
Why is this happening?以上就是jQuery Ajax request - href target ends up outside tags的详细内容,更多请关注web前端其它相关文章!