eae pessoal estou com um problema
quando envio dados via post, em background
tenho um texto em um textArea da aplicação
envio ele…
faço a seguinte verificação, uma linha antes
de chamar o enviar, jogo num alert para verificar
o conteudo, está todo lá…
e quando recebo no servidor mando exibir o
conteudo recebido…
a questão é, no servidor eu não recebi tudo que enviei…
alguem já teve esse problema? conseguiu resolver? :roll:
segue o trecho de codigo que uso para comunicação com o
servidor, função de controle transaction
/*
* Returns an new XMLHttpRequest object, or false if the browser
* doesn't support it
*/
function newXMLHttpRequest() {
var xmlreq = false;
// Create XMLHttpRequest object in non-Microsoft browsers
if (window.XMLHttpRequest) {
xmlreq = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
// Try to create XMLHttpRequest in later versions
// of Internet Explorer
xmlreq = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e1) {
// Failed to create required ActiveXObject
try {
// Try version supported by older versions
// of Internet Explorer
xmlreq = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
// Unable to create an XMLHttpRequest by any means
xmlreq = false;
}
}
}
return xmlreq;
}
//----------------------------------------------------------------------------------------
/*
* Returns a function that waits for the specified XMLHttpRequest
* to complete, then passes it XML response to the given handler function.
* req - The XMLHttpRequest whose state is changing
* responseXmlHandler - Function to pass the XML response to
*/
function getReadyStateHandler(req, responseXmlHandler) {
// Return an anonymous function that listens to the XMLHttpRequest instance
return function () {
// If the request's status is "complete"
if (req.readyState == 4) {
if (req.status == 200) {
responseXmlHandler( req.responseText );
} else {
// An HTTP problem has occurred
alert("HTTP error "+req.status+": "+req.statusText);
}
}
}
}
//----------------------------------------------------------------------------------------
/*
* input - dados a serem enviados para o servidor
* url - url da action que será executada
* handle - método que irá tratar a resposta
*/
function transaction( _input, _url, _handle ) {
// para uso de DEBUG
//alert( _input + "\n" + _url + "\n" + _handle );
var _req = newXMLHttpRequest();
_req.open("post", _url, true);
_req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
_req.onreadystatechange = getReadyStateHandler( _req, _handle );
_req.send( _input );
}
//----------------------------------------------------------------------------------------
[]'s