Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
3.5k views
in Plugins by
can i call php file from javascript written in layer of plugin.

If yes please give a short snippet .
Q2A version: 1.5.1

1 Answer

0 votes
by

Short answer:

Yes. In this jQuery example, the php output will be in the data var.

 

  $.ajax({
    url: "/your-script.php",
    success: function(data){
      /* do something here with php output */
    }
  })
 
Long answer:
 
Research jQuery Ajax. Google will find you a lot of guides and examples.
 
...