Estou utilizando ajax para calcular a tarifa de sedex quando o usuário informa o cep.
Código ajax usado:
function calculasedex(cepD, peso, valor){
var s = "40010";
var co = "01000000";
var cd = (cepD.value).replace(/\D/g,''); // removendo os caracteres não numéricos
var p = peso;
var v = valor;
// metodo ajax pega tarifa
function ajaxInit() {
var req;
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch(ex) {
try {
req = new XMLHttpRequest();
} catch(exc) {
alert("Esse browser não tem recursos para uso do Ajax");
req = null;
}
}
}
return req;
}
ajax = ajaxInit();
if(ajax) {
var urlScript = "CalculaSedex.php"
urlScript = urlScript+"?cep_origem="+co
urlScript = urlScript+"&cep_destino="+cd
urlScript = urlScript+"&peso="+p
ajax.open("GET", "urlScript", true);
ajax.onreadystatechange = function() {
if(ajax.readyState == 4)
{
if(ajax.status == 200)
{
alert("tarifa: "+ajax.responseText);
} else {
alert("Erro: "+ajax.statusText);
}
}
}
ajax.send(null);
}
} // end calculasedex
No inicío do arquivo php, para evitar uso de dados armazenado no cache, estou usando
<?php
$gmtDate = gmdate("D, d M Y H:i:s");
header("Expires: {$gmtDate} GMT");
header("Last-Modified: {$gmtDate} GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
...
As funções em php estão todas funcionando perfeitamente, mas o ajax.statusText me retorna "Not found".
Por que a url não é encontrada? não entendi o que ocorreu.
Agradeço a ajuda!

Nota: os códigos usados foram obtidos em fóruns e tutoriais, estou adaptando as minhas necessidades.