M
morganwhitney
Hi all, I am developing a web app and I am implementing the JavaScript
using the Prototype Framework. I have done all the same stuff from
scratch in a previous application and it worked fine, but I am having a
couple of issues when trying to use Prototype.
1. Parameters are not sent if I specify a transport method:
var url = baseurl+'lib/login.php';
var pars = 'login=' + $F('ad_login') + '&passwd=' + $F('passwd');
var myAjax = new Ajax.Request(
url, {
method: 'get',
parameters: pars,
onComplete: showResponse
}
If I specify either get or post for the method, the parameters do not
get since. I removed the line "method: 'get'," completely and then it
started sending the parameters via post. This is OK since I got it to
work, but it annoys me to no end.
2. ResponseText from AJAX call has extra white space.
my showResponse function that gets called by the onComplete returns the
text with a bunch of extra white space in it. It didn't do this in my
last application and it uses the same PHP script, so I know it is not
actually generating the white space in the response. Because of this,
my application cannot tell whether or not an attempt was successful
because the comparison does not work.
Any ideas?
using the Prototype Framework. I have done all the same stuff from
scratch in a previous application and it worked fine, but I am having a
couple of issues when trying to use Prototype.
1. Parameters are not sent if I specify a transport method:
var url = baseurl+'lib/login.php';
var pars = 'login=' + $F('ad_login') + '&passwd=' + $F('passwd');
var myAjax = new Ajax.Request(
url, {
method: 'get',
parameters: pars,
onComplete: showResponse
}
If I specify either get or post for the method, the parameters do not
get since. I removed the line "method: 'get'," completely and then it
started sending the parameters via post. This is OK since I got it to
work, but it annoys me to no end.
2. ResponseText from AJAX call has extra white space.
my showResponse function that gets called by the onComplete returns the
text with a bunch of extra white space in it. It didn't do this in my
last application and it uses the same PHP script, so I know it is not
actually generating the white space in the response. Because of this,
my application cannot tell whether or not an attempt was successful
because the comparison does not work.
Any ideas?