|
[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. |
|
|
|
|
Asked by MrBaseball9 in Jquery, JSON, PHP for Windows
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);
}
|
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625