Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Pedido Request CTT

$
0
0
Olá Pessoal,

Estou a fazer um trabalho para a univ, e estou fazer um request aos ctt, para saber a localização de um objecto, mas dá me sempre erro :X

Diz sempre canceled. já ando aqui há imenso tempo e não sei porque.

Alguém me dá uma dica?



Código :
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
            <meta charset="UTF-8">
            <title></title>
    </head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
    <script>
$(function(){
$('#enviar').click(function(){
 
    jQuery.ajax({
          type: 'POST',
          data: 'objects=&showResults=true&pesqObjecto.objectoId=RC992163877PT',
          url:'http://www.ctt.pt/feapl_2/app/open/objectSearch/cttObjectSearch.jspx',
          contentType:'application/x-www-form-urlencoded',
         
            success: function(retorno){
            alert(retorno);
          },error: function(xhr,status,err){
                         alert("DEBUG: status"+status+" \nError:"+err+"-->"+xhr.statusText);
                 }
           });
});
});
                                                   
    </script>
    <body >
               
            <input id="enviar" type="button" onclick=""/>
            <input id="result" type="text" />
    </body>
</html>

Viewing all articles
Browse latest Browse all 14700