(XMLHttpRequest) and AppGini
Posted: 2017-03-03 09:45
I'm using an external PHP file in my AppGini project, and I'm using AppGini header and lib files in that file for sure to get the same theme and access to MySQL.
The file works fine when not using AppGini header codes, but when I add them I face a problem! Digging through the code, I found the following:
This PHP file uses a javascript function to check the success of it, using the following code:
When not using AppGini this part (xhttp.responseText) returns "1" so everything works good, but when using it I don't get "1" for that, instead I get html contenet or so as shown in this image.
Is there a conflict between XMLHttpRequest() and AppGini codes? and how can I fix this problem please?
Thank You
The file works fine when not using AppGini header codes, but when I add them I face a problem! Digging through the code, I found the following:
This PHP file uses a javascript function to check the success of it, using the following code:
Code: Select all
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
if(xhttp.responseText == "1")
{
//success, implement next code
} else {
//failed
alert("ERROR , couldn't save this") ;
}
}
Thank You