jAPI Direct

jAPI Direct

Released 7 years ago , Last update 7 years ago

Run PHP code from Javascript via AJAX and the reflection API. Reuse your PHP logic in your Javascript code.

This class can be used to handle calls to PHP class methods from Javascript code.

It registers PHP classes that will can be called and uses AJAX requests to call it from Javascript. The output of the method calls is returned as response to the AJAX requests.

  • 5 3
  • 4 0
  • 3 0
  • 2 0
  • 1 0
3 Reviews Read Reviews


14 day 14-day money-back guarantee



The GNU GPL is an open-source license.

How to use

jAPI Direct contains PHP and JavaScript scripts that enables you to call PHP methods directly from JavaScript just by typing their names in Javascript syntax.

For example you can call the following PHP method:

class MySimpleMath {
          public function Addition($firstParam, $seccondParam) {
                    $sum = $firstParam+$seccondParam;
                    echo $sum;

By calling it from JavaScript:


The result returned will be "3"



Include both jAPI.js and jAPI-Remote.php as Javascript <script> tags (jAPI-Remote.php will generate Javascript for the tag).

You can replace jAPI-Remote.php with any PHP script that will register the PHP classes to use (see the provided example). That script will have to include jAPI-Core.php script:


And declare the classes to use as parameters to the jAPIBaseClass constructor:

new jAPIBaseClass('YourClass,AnotherClass');

You can then call registered classes methods directly from Javascript.

License » GNU GPL Download

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

Or enter your name and Email
No comments have been posted yet.