Jump to content

Control Load Order? of Site


Iosys

Recommended Posts

I'm trying to control the load order of the browser. The default load order is from top to bottom.

 

Well I have a table that is made in html with more code bellow the table.

 

My php data that I put inside the html table is

<?php
include("table/table.php");
?>

 

that grabs the data that will go into my html table.

 

Well the problem I'm having is that the rest of the table with stuff under the table won't load till the php is done being processed.

This makes my site look weird for 4 seconds and is the reason why I want to load the php content last.

 

Is there a way to do this with php or javascript?

Link to comment
Share on other sites

I'm trying to control the load order of the browser. The default load order is from top to bottom.

 

Well I have a table that is made in html with more code bellow the table.

 

My php data that I put inside the html table is

<?php
include("table/table.php");
?>

 

that grabs the data that will go into my html table.

 

 

Well the problem I'm having is that the rest of the table with stuff under the table won't load till the php is done being processed.

This makes my site look weird for 4 seconds and is the reason why I want to load the php content last.

 

Is there a way to do this with php or javascript?

 

 

 

 

Do it like this:


// INSERT THIS AT THE VERY TOP OF THE PAGE
$table_content = include('table/table.php');

// INSIDE THE TABLE RUN THE $table_content VARIABLE AND IT WONT LOOK WEIRD....

 

 

Just a quick explanation of why you can do it like this:

 

By adding the variable at the very start of the page, the page will have to load all of its information before moving on the loading the table.

This way the loading-time of the variable is kept outside the loading of the table surrounding the information.

And now you know. If you didnt understand at first :-)

 

Hope it helps

Link to comment
Share on other sites

thanks for the reply, I'm a very new beginner with php and I'm still having issues.

 

If I insert

<?php
$table_content = include('table/table.php');
?>

 

at the top of the paqe, the data loads first but it shows up where i insert that code

Link to comment
Share on other sites

thanks for the reply, I'm a very new beginner with php and I'm still having issues.

 

If I insert

<?php
$table_content = include('table/table.php');
?>

 

at the top of the paqe, the data loads first but it shows up where i insert that code

 

 

Sorry about that one. Youre absolutely right, it loads right away.

Well, if it takes 4 sec to load its probably a lot of content (?).

The include function doesnt cause any extra delay (or at least you wont be able to notice) so you might have to get used to waiting 4 sec.

Or you can try to add your data to a SQL table, but i dont think that will load any faster. And since youre new to PHP/MySQL i wouldnt recommend taking on SQL yet.

 

I dont know what the best solution is to be honest. Hopefully some other on this forum come up with a better answer for you!

And again, sorry about the confusion on the first reply.

 

 

Have a nice one

Link to comment
Share on other sites

The delay isn't really the issue to me at all if I can get the things after the code to load before.

I'll try to explain the problem more of why its an issue if I didn't really explain it good to begin with.

 

The delay is bad because its blocking the rest of the page to load which to me is the layout and makes the page look weird by not showing rows or columns in the layout.

When the php is done loading it does the layout in an instant which makes it look good again.

 

My site is pvpstreams.com and you can see what i mean by looking at how it shifts to right in beginning and then goes back to center.

So i'm trying to get the stuff in middle to load last, after the layout.

Link to comment
Share on other sites

The delay isn't really the issue to me at all if I can get the things after the code to load before.

I'll try to explain the problem more of why its an issue if I didn't really explain it good to begin with.

 

The delay is bad because its blocking the rest of the page to load which to me is the layout and makes the page look weird by not showing rows or columns in the layout.

When the php is done loading it does the layout in an instant which makes it look good again.

 

My site is pvpstreams.com and you can see what i mean by looking at how it shifts to right in beginning and then goes back to center.

So i'm trying to get the stuff in middle to load last, after the layout.

 

 

Your website opened perfectly on my macbook,.. Took less than 0,2 sec to load all the data.

Maybe its your DSL thats too slow.. Im having 2,4mbit download rate right now and thats not super fast so say at least.

If you use dial-up (dont think you do, but just to mention it) or anything like this it might take several seconds to load the website for YOU, but not for anyone else.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.