<script language="javascript"> function updateCpt() { $.ajax({ type: "GET", url: "/cpt.xml", dataType: "xml", success: function(xml) { var CptDate = $(xml).find("date").text(); var CptDays = $(xml).find("days").text(); var CptDams = $(xml).find("dams").text(); var CptPeople = $(xml).find("people").text(); $("#cptdays").text(CptDays); $("#cptcitizen").text(CptPeople+"%"); $("#cptdams").text(CptDams+"%"); $("#cpt0day").text(CptDate); } }); }; $(document).ready(updateCpt()); </script>