Hi all!
I need to be able to load part of my page with jQuery, however the PHP I am loading needs to have access to a class (singleton database class)
The main page includes all the necessary PHP classes, there is a container on this page that will be populated on click with a PHP file that will need to run the database class in order to create itself.
The Problem is when I click the element that loads this file it will load the page correctly, however will not load any of the information that is needed, and gives the following error as It can not see the class:
Fatal error: Class 'Database' not found
My understanding is that PHP is a server side language and will initiate the classes on DOM load and any reference made after that will not be reconsigned.
Is there any work around for this?
I haven't included any code or markup as there is alot I would have to show but I will put it up if needed.
class not found after jquery .load
Page 1 of 11 Replies - 2542 Views - Last Post: 29 April 2014 - 05:20 AM
Replies To: class not found after jquery .load
#2
Re: class not found after jquery .load
Posted 29 April 2014 - 05:20 AM
Quote
My understanding is that PHP is a server side language and will initiate the classes on DOM load and any reference made after that will not be reconsigned.
on DOM load PHP is long done processing. all server-side activity happens and finishes before any client-side code.
Quote
Is there any work around for this?
make your AJAX script load the classes it needs. in other words, treat a script called through AJAX exactly like a script called through a regular request.
Page 1 of 1

New Topic/Question
Reply



MultiQuote


|