Hi,
I've got a problem with reading up to date XML. The following code works fine in loading my XML up. However if the XML is changed and the page refreshed it recalls these functions correctly but still uses the out of date XML prior to the alterations. Any help would be much appriciated.
function AdminCourseLoadDropDown()
{
url = CourseURL;
xmlhttp2=null;
if (window.XMLHttpRequest)
{
xmlhttp2=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP")
}
if (xmlhttp2!=null)
{
xmlhttp2.onreadystatechange=state_Change_Course
xmlhttp2.open("GET",url,true)
xmlhttp2.send(null)
}
else
{
alert("Your browser does not support XMLHTTP.")
}
}
function state_Change_Course()
{
if (xmlhttp2.readyState==4)
{
if (xmlhttp2.status==200)
{
var response = xmlhttp2.responseXML.documentElement;
var x=response.getElementsByTagName("ENTRY")
var prev = "";
var txt = "";
var lock = "";
for(i=0;i<x.length;i++)
{
prev = txt;
try
{
xx = x.getElementsByTagName("LOCK");
lock = xx[0].firstChild.data;
xx = x.getElementsByTagName("CATEGORY");
category = xx[0].firstChild.data;
match = document.getElementById('admincourseamendcategoryselect').value;
if (lock != "1" && match == category)
{
xx=x.getElementsByTagName("ID");
txt = txt + "<option value='" + xx[0].firstChild.data + "'>";
xx=x.getElementsByTagName("COURSE_NAME");
txt = txt + xx[0].firstChild.data + "</option>";
}
}
catch(ex)
{
txt = prev
}
}
strOption = txt;
buildCategoryDropDown("admincourseamendcourse","admincourseamendcourseselect","");
}
else
{
alert("Problem retrieving XML data:" + xmlhttp2.statusText);
}
}
}
I've got a problem with reading up to date XML. The following code works fine in loading my XML up. However if the XML is changed and the page refreshed it recalls these functions correctly but still uses the out of date XML prior to the alterations. Any help would be much appriciated.
function AdminCourseLoadDropDown()
{
url = CourseURL;
xmlhttp2=null;
if (window.XMLHttpRequest)
{
xmlhttp2=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP")
}
if (xmlhttp2!=null)
{
xmlhttp2.onreadystatechange=state_Change_Course
xmlhttp2.open("GET",url,true)
xmlhttp2.send(null)
}
else
{
alert("Your browser does not support XMLHTTP.")
}
}
function state_Change_Course()
{
if (xmlhttp2.readyState==4)
{
if (xmlhttp2.status==200)
{
var response = xmlhttp2.responseXML.documentElement;
var x=response.getElementsByTagName("ENTRY")
var prev = "";
var txt = "";
var lock = "";
for(i=0;i<x.length;i++)
{
prev = txt;
try
{
xx = x.getElementsByTagName("LOCK");
lock = xx[0].firstChild.data;
xx = x.getElementsByTagName("CATEGORY");
category = xx[0].firstChild.data;
match = document.getElementById('admincourseamendcategoryselect').value;
if (lock != "1" && match == category)
{
xx=x.getElementsByTagName("ID");
txt = txt + "<option value='" + xx[0].firstChild.data + "'>";
xx=x.getElementsByTagName("COURSE_NAME");
txt = txt + xx[0].firstChild.data + "</option>";
}
}
catch(ex)
{
txt = prev
}
}
strOption = txt;
buildCategoryDropDown("admincourseamendcourse","admincourseamendcourseselect","");
}
else
{
alert("Problem retrieving XML data:" + xmlhttp2.statusText);
}
}
}