I'm trying a simple test with python & ajax, but it doesn't work out: there is no response to the XMLHttpRequest.
app.yaml content:application: poarsbr801
version: 1
runtime: python
api_version: 1
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /htmlpages
static_dir: htmlpages
- url: .*
script: main.py
relevant parts of htmlpages/testajax.html: function loadXMLDoc(filename) {
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET",filename,true);
xmlhttp.send();
}
....
....
<BODY>
<FORM>
<INPUT type="button" value="Ajax" onclick="loadXMLDoc('htmlpages/texto.txt')"><br>
</FORM>
<DIV id="myDiv">
<H2>text to be changed by htmlpages/texto.txt content</H2>
</DIV>
</BODY>
Clicking on the button doesn't return anything.
Help me please!