Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Best practice load dynamic PHP using Jquery load();

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36181
    fjorko
    Member

    What is the best practice in doing the above if the PHP you are loading is already a dynamic page in itself with JS and CCS defined in the head tags.

    I’m thinking TABS here, I have 4 customers for arguments sake, each customer has a dashboard created for them using PHP, Jquery & MySQL that shows me stats about their Exchange Systems ( Mail queues etc ).

    Currently each customer has their own folder on the web server so to get to their dashboard i go to :

    http://webserver/customer

    This loads index.php and I can see all their stuff.

    Now instead of folders defining their area, and having to open a new tab in the browser to see each customer’s dashboard, I want to create a single page and create a bunch of tabs at the top, 1 tab per customer.

    So if i click on customer 1’s tab, it will “load” the relevant customer’s index.php inside a holder DIV that I will create on the main page underneath the tabs.

    What I want to know is whether I need to define all styles and JS in the “main” page, or do I leave it defined in each customer’s index.php

    What is best practice ?

    #95373
    jamygolden
    Member

    I’d say it’s best to define them on the main page.

    I usually have all my css in 1 file and all my custom js in 1 file too. So I would never load custom scripts or javascript for a specific page (unless the page required multiple extra libraries or something).

    Also, in production it’s best to minify your CSS and javascript. So minify + 1 file = best practice for production I’d say.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.