How to stop my xml file duplicating on refresh but renewing instead?

LORDDRAD

New Member
I have this xml file which has text init.i.e Hi my name is stevenWhen i add a Setinterval to load the xml file every 10 seconds i getHi my name is stevenHi my name is stevenHi my name is stevenHi my name is stevenThis continues duplicating every 10 secondsHere is my javascript xml function\[code\]myLoadInteval = setInterval(Xml, 10000);function Xml(){ $(document).ready(function() { $.ajax({ type: "GET", url: "http://www.mobilefriendlywebapps.co.uk/tayloredtest1/note.xml", dataType: "xml", success: parseXml }); function parseXml(xml) { $(xml).find("menu").each(function() { //find each instance of loc in xml file and wrap it in a link $("div#site_list").append( $(this).find("cd").text() ); $("div#treatments").append( $(this).find("cd1").text() ); $("div#preparation").append( $(this).find("cd2").text() ); $("div#products").append( $(this).find("cd3").text() ); $("div#info").append( $(this).find("cd4").text() ); $("div#price").append( $(this).find("cd5").text() ); $("div#promo").append( $(this).find("cd6").text() ); }); } }); \[/code\]}How do i remove the old xml before the new on loads?
 
Back
Top