Results 1 to 4 of 4

Thread: Call a php function after the page loads.

  1. #1
    Join Date
    Jul 2014
    Beans
    25

    Call a php function after the page loads.

    I'm making a website wher i have a table where quotes (finance) are loaded from a csv file. When i visit the page it takes i while to load the page becauese of the csv files. Is there a way to load that part of the page after everything else has loaded ?

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Call a php function after the page loads.

    You could perhaps use an iframe for the data display and have that call a second PHP script to load the data.

    Have you considered uploading the csv data into an SQL database like PostgreSQL or MySQL? Retrievals would probably be faster.

    Another possibility is to load the csv data once and store it in a session so it is immediately available to all other pages after the initial load. That won't speed up the initial loading, but it might move later pages along.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3

    Re: Call a php function after the page loads.

    As an idea you could call another php script via AJAX once the page loads and have the php script page contents load in a div.

  4. #4
    Join Date
    Jul 2014
    Beans
    25

    Re: Call a php function after the page loads.

    Thanks all for your help.
    I use javascript onLoad function to bring it in after the rest of the page has loaded.
    and then call the data into a php array function and then display it.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •