Include PHP inside JavaScript js files

0 votes

I have a JavaScript file with numerous JavaScript methods in it (.js extension, not.html).

I want to invoke a PHP function from within a JavaScript function in a PHP file that only contains other PHP functions.

  • Is that possible?
  • Would I need to "include" the .php file containing the PHP function in the .js file?
  • How would I do that?
Jul 24, 2022 in PHP by Kithuzzz
• 38,010 points
1,281 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to include a PHP variable inside a MySQL statement?

Hii, You can try this: $query="SELECT * FROM CountryInfo ...READ MORE

answered Apr 9, 2020 in PHP by Niroj
• 82,880 points
15,956 views
0 votes
0 answers

how to write javascript code inside php

I have a form, and when I ...READ MORE

Aug 7, 2022 in PHP by Kithuzzz
• 38,010 points
548 views
0 votes
1 answer
0 votes
1 answer

How do I recursively delete a directory and its entire contents files as well as sub dirs in PHP?

Hello @kartik, The user-contributed section in the manual ...READ MORE

answered Aug 24, 2020 in PHP by Niroj
• 82,880 points
797 views
0 votes
1 answer

How to delete all files from a folder using PHP?

Hello @kartik, Use this: $files = glob('path/to/temp/*'); // get ...READ MORE

answered Sep 14, 2020 in PHP by Niroj
• 82,880 points
1,131 views
0 votes
1 answer

How can I select and upload multiple files with HTML and PHP using HTTP POST?

Hello @kartik, This is possible in HTML5. Example (PHP ...READ MORE

answered Sep 15, 2020 in PHP by Niroj
• 82,880 points
1,649 views
0 votes
1 answer
0 votes
0 answers

Anyone can help me out to understand the semantic of (document.getElementBYId("demo").innerHTML="Hello") ?

Hello guys, Can Someone helps me to find ...READ MORE

Jan 17, 2020 in Web Development by anonymous
• 37,510 points
750 views
+1 vote
1 answer

What is the relationship between angularjs Scope with controller/view?

Let us consider the below block: <div ng-controller="emp"> ...READ MORE

answered Jan 20, 2020 in Web Development by Niroj
• 82,880 points

edited Jan 21, 2020 by Niroj 807 views
0 votes
1 answer

What is data binding in AngularJS?

Data binding is synchronization of data between the ...READ MORE

answered Jan 23, 2020 in Web Development by Niroj
• 82,880 points
850 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP