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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| <script type="text/JavaScript">
var alexaxml = "document.xml"; // MARCHe
//var alexaxml = "http://karlstabo.se/document.xml"; // MARCHe PAS
$(document).ready(function() {
// run this when the whole page has been downloaded
get_alexa_popularity(alexaxml)
});
function get_alexa_popularity(alexaxml)
{
$.ajax({
url: alexaxml,
type: 'GET',
dataType: 'xml',
timeout: 1000,
error: function(){
alert('Error loading XML document');
},
success: function(xml){
// do something with xml
// alert(xml);
$(xml).find('REACH').each(function(){
var index_reach = $(this).attr('RANK')
$("#quote p").html(index_reach);
}); //close each
/*
$(xml).find('POPULARITY').each(function(){
var index_popularity = $(this).attr('TEXT')
//var name_text = $(this).find('name').text()
//alert(index_popularity)
}); //close each
$(xml).find('LINKSIN').each(function(){
var index_linksin = $(this).attr('NUM')
//alert(index_linksin)
}); //close each
*/
}
});
}
</script> |
Partager