Call an instantiated class's function from javascript
Posted: Thu Jan 28, 2016 2:19 pm
First some background and please let me know if what I'm doing is not on the right track.
I have a php page that has a form that accepts some input.
I also have a PHP class that basically does a bunch of queries that I instantiate at the top of the form.
When an event happens, say an input box's onChange event, I'd like to call a function in the instance of my PHP class that, say returns an array, that I can manipulate with Javascript.
I realize that this is going to be some sort of AJAX call, but I can't seem to figure out how to access the instance of my class's functions.
Hope this makes sense.
Thanks in advance.
I have a php page that has a form that accepts some input.
I also have a PHP class that basically does a bunch of queries that I instantiate at the top of the form.
When an event happens, say an input box's onChange event, I'd like to call a function in the instance of my PHP class that, say returns an array, that I can manipulate with Javascript.
I realize that this is going to be some sort of AJAX call, but I can't seem to figure out how to access the instance of my class's functions.
Hope this makes sense.
Thanks in advance.