PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Oct 18, 2018 1:13 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Sep 17, 2017 12:53 am 
Offline
Forum Newbie

Joined: Sun Jan 04, 2009 6:17 am
Posts: 5
I have been searching for something like this, but am unable to find a good solution. I have a page that has 3 tables. Each table uses CURL to pull json info and fill the tables, one by one. Each table is located in a different php file on the index.php page. The page loads in order of the files, and sometimes can take a while depending on the amount of data it is pulling....I would like to put a loading image or if possible a progress bar over the top of each table while/until they load fully...The only solutions I have been successful with is using JavaScript and a loading image for the whole page....I need each section separate....Here's an example of my structure.

Syntax: [ Download ] [ Hide ]
<?php // index.php
include 'table_1.php'; // loads json into table
include 'table_2.php'; // loads json into table
include 'table_3.php'; // loads json into table
?>


Top
 Profile  
 
PostPosted: Sun Sep 17, 2017 6:35 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
I think a JS solution might make the most sense here. Have the server send the structure of the page but without the data. Frontend sends AJAX calls to retrieve the data, displays a spinner until the promise is resolved, then updates the page and hides the spinner.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group