How to call WordPress PHP file using external js file

I have added custom PHP file in WordPress directory and added following line to use WordPress functions:

require ('../wp-blog-header.php');

Now I am able to use WordPress functions but unable call this file from javascript in ajax.

When I removed following line then I am able to call this file:

require ('../wp-blog-header.php');

Please suggest how can I solve this issue.

Topic wp-blog-header.php functions php jquery Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.