[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

Create JSON text file at specific interval

Asked by MrBaseball9 in Jquery, JSON, PHP for Windows

Tags: Jquery, JSON, php

I have a program  running Jquery that calls an external php file that grabs data from a database, and then puts the data in a JSON array. The external php file is called every X seconds through jquery. The query pulls out data for 50 users, each having about 6 different fields per user.

This is displaying my content, but now that there's 10+ supervisors all viewing this website with the content provided by JSON, it's forcing the external php file to fire off every second since the interval is based on when each supervisor loads the page.

What I'd like to do is set up my external php file to write the json data to a text file... then force the webpage to point to the json.txt file... then set the external php page to fire of every X seconds.

Can anyone point me in the right direction?  Website is running on a windows server w/ IIS 5
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Here's an example of how I'm calling the external php file. I would like to change "fetchStats.php" to be fetchStats.txt.... and then somehow get fetchStats.php to create the txt file every X seconds.
 
var updateStats = function() {
$.getJSON("fetchStats.php",
function(stats){
 
var emailers = stats.sla.emailAgents;	
var available = stats.sla.availableAgents;
var unavailable = stats.sla.unavailableAgents;
var talking = stats.sla.talkingAgents;
$('#emailers').html(emailers);	
$('#talking').html(talking);
$('#available').html(available);
$('#unavailable').html(unavailable);	
});
setTimeout('updateStats()',3000);                      
}
[+][-]09/29/09 03:23 PM, ID: 25453999Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 03:30 PM, ID: 25454049Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 03:34 PM, ID: 25454068Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/29/09 03:39 PM, ID: 25454110Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/29/09 04:14 PM, ID: 25454306Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/29/09 04:28 PM, ID: 25454413Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/01/09 04:12 AM, ID: 25467467Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/01/09 04:33 PM, ID: 25474136Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/02/09 06:36 AM, ID: 25477695Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625