¿Cómo uso DownloadUrl con AJAX y Google App Engine?

The snippet of JavaScript that I am having trouble with looks like this:

var content_value = encodeURI(document.getElementById("chattext").value)
downloadUrl("/getchats", "POST", "content=" + content_value, onChatsReturned);

This code works, but it only posts the content. How would I have to change this in order to post another item, such as a description? I have all the other code ready and working, I just don't know how the parameters work for downloadUrl.

preguntado el 08 de noviembre de 11 a las 16:11

¿Qué es? downloadUrl? It's not a built-in Javascript function - you must be getting it from somewhere. -

You were right, I have the function downloaded in my util.js file -- function downloadUrl(url, type, data, callback) -

How in the world is anyone else supposed to know what the parameters of a function in your util.js file do? -

1 Respuestas

It's quite hard to say anything for certain since I can't know what downloadUrl() function actually does, but here is a solution that at might solve your problem (if it just passes the 3rd argument to the backend).

downloadUrl("/getchats", "POST", "content=" + content_value + "&description=" + desciption_value, onChatsReturned);

As the comments mention more information on the downloadUrl-function is needed to say for sure.

respondido 09 nov., 11:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.