Hi EEers,
I’ve had a few bumps in the road while upgrading to 2.1 from 1.6.8, but I’m almost done. I do have an issue I can’t resolve though. I can’t get any GET parameters to submit. Anytime I try to submit XMLHttpRequest with a parameter or try navigating to the page directly with parameters, I get a 404 error. If I remove the ? and all the parameters, I get a 200 response and the page loads. This same code worked perfectly in 1.6.8. Any ideas?
I’m using the Input class to pull the data out. It works well when I manually set the $_GET variable and assume it will work when I’m able to submit a request with GET parameters.
A few of the things I’ve tried that have failed: 1. Changing the $config[‘uri_protocol’] variable in my config.php file to PATH_INFO 2. Absolute paths 3. Cussing (for some reason this never works 😊)
Here is my code:
function loadXMLDoc(elementID, category)
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById(elementID)[removed]=xmlhttp.responseText;
}
}
xmlhttp.open("GET","clients/load-companies"+"?category="+category,true);
xmlhttp.send();
}Thanks in advance!
Have not tried that.
My situation is a little different than the one described above. I am trying to do a .get using javascript but the result is the same. The file is not found because the get variables is confusing whatever is trying to determine the template being instantiated.
The following does not work …
$.get("{path=site/ajax_validate_conf_number}",
{
type: 'offer',
trade_id: tid,
conf_no: cno
},
function(data) {
if (data == 'TRUE') {
alert("Confiramtion Match - Trade is Complete!");
} else {
alert("Error - "+data);
}
});If I change the .get to .post it works fine.
Note in the same javascript file I use the jquery .load which the jquery documentation says is essentially the same as a .get but actually works more like a .post as there is no get variables.
My .htaccess file is minimal …
AddType x-mapp-php5 .php .php4My config.php file is set as so ….
$config['uri_protocol'] = 'AUTO';
Here is the get as seen by firebug. It returns a code of 200 (OK) and the reponse data consists of the contents of my index.html page.http://mysite.us/index.php/site/ajax_validate_conf_number?type=offer&trade_id=254&conf_no=1234 <pre><code>
If I replace the .get with a .post it works fine.
Thanks for your help!
Can you try switching between $config[‘uri_protocol’] = ‘REQUEST_URI’ and $config[‘uri_protocol’] = ‘PATH_INFO’?
It looks like the templates are not getting routed properly and this is often the case with $config[‘uri_protocol’] = ‘AUTO’ as this first looks to the query strings to route the template.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.