Good afternoon, I am developing a php page in which there is an iframe that opens another php page with a flag in it, this second page, when the user clicks on this flag, must make an ajax call to confirm "click".
so there is pageA.php, with an iframe in it that points to pageB.php, in this there is only a form with a checkbox and javascript (vanilla javascript) that can call the third page when clicked.
this is the javascript that i use to send the "click":
document.getElementById("checkboxMe").onclick = function() {
xhttp.open("POST", "pageC.php", true);
xhttp.send("foo=bar");
};
when I click on the checkbox, this is what I see on the console:
Uncaught ReferenceError: xhttp is not defined
there is never something like this, infact. I cannot easily find this error in google, does anyone have any clues? maybe it's a fact that I'm in an IFrame? how can i solve this problem?
ppl.