It just does nothing and shows nothing on the page. Can I ask what code you used?
Also, I will attach the file "somefile.xml" but I have to rename it somefile.txt
Main Topics
Browse All TopicsHi, I was trying to use the setInterval() function in Javascript but am not getting anywhere. In the code attached there is a function called showAddress() which is called near the end of the page around line 93. This is called within an Ajax call. I am using Ajax to read a file on the server and then parse that file and then use showAddress() to take some of what was read (a location) and then show it on the page (on a map).
I want this showAddress() function to run every minute.
I was trying to use var refreshId = setInterval(function() but cannot get it to work.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
hi. Thanks. I tried that but it is inside the .each function and so it won't show all the results each time but just one at a time (actually it did not even do that). So then I tried the code below but I get a blank map (no markers):
here is the page: http://www.sentimentmining
and here is what it should look like but without a timer (the markers are clickable:
http://www.sentimentmining
Hi. Here is what I have. Maybe I have my brackets mixed up but I am not showing any markers. I misinterpreted your previous instructions and thought I should post this in jquery. Thanks.
$(document).ready(function
{
$.ajax({ type:"GET"
,url:"somefile.xml"
,dataType:"xml"
,error:function(XMLHttpReq
{
alert(textStatus);
}
,success: function(xml)
{ tId[tId.length]= setInterval(
var locationText="";
$(xml).find('statuses > status ').each(function()
{
locationText="";
textText="";
locationText += $(this).find('user > location').text();
//textText += $(this).find('status > text').text();
textText += $(this).find('text').text(
showAddress(locationText, textText);
});
, 10000);
}
});
});
This is not possible:
{ tId[tId.length]= setInterval(
var locationText="";
$(xml).find('statuses > status ').each(function()
{
locationText="";
textText="";
locationText += $(this).find('user > location').text();
//textText += $(this).find('status > text').text();
textText += $(this).find('text').text(
showAddress(locationText, textText);
});
, 10000);
}
this might be
{ tId[tId.length]= setInterval(
function() {
var locationText="";
$(xml).find('statuses > status ').each(function()
{
locationText="";
textText="";
locationText += $(this).find('user > location').text();
//textText += $(this).find('status > text').text();
textText += $(this).find('text').text(
showAddress(locationText, textText);
});
} , 10000);
}
Business Accounts
Answer for Membership
by: DreamwarePosted on 2009-08-09 at 23:13:30ID: 25057465
What error message is it giving you? I tried setting it up, but Could not reproduce your error since I don't have the xml file you are using.