Subject: | Outside URL |
Ajax seems not correctly determine URL when using outside script in situation when query string parameters were passed to original script.
Consider snippet below:
var l = ajax.length-1;
var sep = '?';
if ( window.location.toString().indexOf('?') != -1) { sep = '&'; }
if ( 'external_script.cgi' == '0') {
ajax[l].url = window.location + sep + ajax[l].url;
} else {
ajax[l].url = 'external_script.cgi' + sep + ajax[l].url;
}
ajax[l].send2perl();
Here "sep" is overwritten if current window.location contains '?', but shoud not if 'external_script.cgi' is used.
This leads to 404 Page Not Found when submitting URL of kind:
external_url.cgi&fname=bla-bla...