Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old July 25th, 2006, 03:36 AM   #1
New Member
 

Join Date: Jul 2006
Location: mumbai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 shailu is on a distinguished road
using xml in javascript

Hi,

I am calling an xml using javasript.I am able to call the xml but the xml is getting cached on client machine forever.Even though if any changes done in the xml file still the cached xml is used from the client machine.Since the http request is used for calling a xml hence ideally the cached xml is used from the client machine untill its contents are changed.


Pls find the code I have used...

pls help before my boss kills me

// to load the xml
function loadreq(url)

{

// branch for native XMLHttpRequest object
if (window.XMLHttpRequest) {
req_Head = new XMLHttpRequest();
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.send(null);
req.open("GET", url,true);
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
req_Head = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
req_Head.open("HEAD", url,true);
req.open("GET", url, true);
req.send();

}
}
}


//to read the xml
function processReqChange()
{
if (req.readyState == 4) {
if (req.status == 200) {
var Gujarati_News ;
var response = req.responseXML.documentElement;
var news=response.getElementsByTagName("news")
i= 0
var news_texts ;
news_texts = ""

for(var i=0; i<= news.length-1; i++){
// create a string
news_texts = news_texts + "<a href='../quressan/news.asp?newsid=" + news[i].getAttribute("links") +"&typeid="+news[i].getAttribute("typeid")+"'><font size='2' color='#1c355d' face='arial'><b>*" + response.getElementsByTagName("news")[i].firstChild.nodeValue+ ">> </b></font></a>"

if(news[i].getAttribute("dt_tm")!=""){
dt_tm = news[i].getAttribute("dt_tm")
news_texts = news_texts + "<br><font size='1' color='#1c355d' face='arial'>(" + dt_tm + ")</font>"
}
news_texts = news_texts + "<br><br>"
}
news_text.innerHTML = news_texts ;

} else {
alert("There was a problem retrieving the XML data:\n" + req.statusText);
}
}
}
shailu is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
using , xml , javascript


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
php and javascript yvettesio JavaScript 8 March 14th, 2007 08:18 PM
Javascript Help Daniel JavaScript 5 January 4th, 2007 06:00 PM
JavaScript cbrams9 JavaScript 1 September 20th, 2006 01:35 PM
Can someone help me with this javascript Galaxyblue JavaScript 2 March 11th, 2004 08:18 AM
what does \\ mean in javascript jenjen1018 JavaScript 5 January 6th, 2004 01:05 PM


Search Engine Optimization by vBSEO 3.2.0 RC8