1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
$.ajax( {
type : "GET",
url : "http://keyserver.gingerbear.net/pks/lookup?",
data : "search=john.smith@gmail.com&fingerprint=on&op=index",
dataType: "html",
success : function(resultat){
showMessages("*****AJAX : SUCCESS*****");
// Cette instruction me permet d'afficher le résultat de la requête
console.log(resultat);
// Mais je n'arrive pas à parser le contenu de la variable resultat avec jquery
$(resultat).ready(function() {
$('pre',$(resultat).html()).each(function(){
var htmlString = $(this).html();
console.log("Key ID : "+/0x[a-z0-9]{16}/i.exec(htmlString));
console.log("User : "+$(this).find('a:eq(1)').text());
console.log("Bits : "+/[0-9]{4}[RD]/.exec(htmlString));
console.log("Data : "+/[0-9]{4}-[0-9]{2}-[0-9]{2}/.exec(htmlString));
console.log("Fingerprint : "+/Fingerprint=(.*)/.exec(htmlString));
});
});
},
error : function(resultat, statut, erreur){
//Blabla
},
complete : function(resultat, statut){
Blabla
}
} ); |