xhttp is not defined when using ajax calls into an iframe
xhttp
is not a browser built-in. If you don't define it yourself then it won't be defined. Frames are irrelevant to that problem.
Perhaps you intended to first:
var xhttp = new XMLHttpRequest();