When I call a PHP file using,
var xhr = new XMLHttpRequest();
xhr.open('POST', 'file.php');
xhr.setRequestHeader('Accept','*/*');
xhr.setRequestHeader('X-Requested-With','XMLHttpRequest');
xhr.onload = function() {
document.getElementById('container').innerHTML = xhr.responseText;
};
the responseText doesn't include jQuery.ajax call in file.php. However when I do this same thing using
jQuery.ajax{(
url: 'file.php',
type: 'post',
success: function (data) { jQuery('#container').html(data); }
)};
The data includes jQuery.ajax call in file.php.
I am trying to figure out why XMLHttpRequest won't do this for me.