Passing url in async xhttp request not hitting server (although does it
first time) - getting syntax error
In my html5 template (also using GAE and datastore/python), I'm making an
async js call to server and coming back with some more categories which in
turn go through the same async call to get more categories depending on
which one is selected. It works the first time, but in the second, an odd
things happens. It comes back with a syntax error. The call doesn't even
seem to make it to the method (no logs!), what gives???
The first time the catkey is populated with jinja object key --->
html_output += "" + nameString + "
"; which works BUT the second time, I'm using the results from the first
one to generate categories to call json again to get more for (var key in
cat_JSON) { html_output += "" + key + "
";
the cat_JSON[key] is a string --- there is something funky going on - but
the console logs for the url seem to be ok and I don't see any evidence it
is actually reaching server method.
function getNextLevel(catkey,catname, column) {
url = "/api/filter/" + catkey;
subjectAPI.open("GET", url, true);
console.log("url is ", url);
subjectAPI.onload = function() {
var cat_JSON = JSON.parse(this.responseText);
No comments:
Post a Comment