Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-04-2012, 06:06 PM   PM User | #1
jbrown1028
New Coder

 
Join Date: Sep 2006
Location: Fostoria, Ohio
Posts: 35
Thanks: 4
Thanked 0 Times in 0 Posts
jbrown1028 is an unknown quantity at this point
.load inside .each

Hey guys, tried to search for this, although I am not even sure what I am searching for. My problem is this:

Code:
$.getJSON('process.countfiles.php?action=getfiles', function(data) {
	$.each(data, function(name, value){
		$("#displayfile").load("process.files.php?file="+value, function(){
		});
	});
});
OK, I am having a script (process.countfiles.php) with 2 functions, 1 - count the files and build a file list in a .dat file. Then number 2 is open the .dat file and process the files individually.

The first parts works great, so let move to the second part... I have the data being passed from PHP like this:

PHP Code:
    $fh fopen($dirdatafn"r");
        while (!
feof($fh)){
            
$data_file_line[] .= fgets($fh);
        }
        @
fclose ($fh);
        echo 
json_encode($data_file_line); 
Now back to the JS (jQuery is the framework I am using for this) data is the array of $data_file_line from the PHP, it gets the data with no problem, then it should start separating them with the .each

The problem is, it will try loading all 7,000+ at the same time and send them all to the process.files.php, when I would like it to handle one at a time.

Any help would be appreciated.

Thank you,
Jeff
jbrown1028 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:57 AM.


Advertisement
Log in to turn off these ads.