0

I'm sending out AJAX request for a XML file to plot a chart. The problem is everytime the response comes back, the chart refresh itself, even if the XML is exactly the same.

I would like to use Javascript to check the content of the reponse XML with the cached XML, and only push to the chart if there are changes, dont do anything if it's the same.

How do I retrieve the cached XML?

Thanks!

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by jerrytouille
0

Newvermind I finally got it.

if (i != 0) // if not 1st run
   currentXML = newXML;

newXML = xmlhttp.responseText;
i = 1;

if (newXML != currentXML) // if XML content changes
{
  ...plot the chart...
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.