About 12,800,000 results
Open links in new tab
  1. How to call a JavaScript function from PHP? - Stack Overflow

    this is not working. i tried both of them. the follow of my program is, from .html (on button click) it goes to an external .js function which load a php file (using xmlhttp=GetXmlHttpObject();var …

  2. How do I embed data generated by PHP code in JavaScript?

    We can't use "PHP in between JavaScript", because PHP runs on the server and JavaScript - on the client. However we can generate JavaScript code as well as HTML, using all PHP …

  3. How can I call PHP functions by JavaScript? - Stack Overflow

    The library allows importing php functions and class methods into javascript browser environment thus they can be accessed as javascript functions and methods by using their actual names. …

  4. How to execute PHP code within JavaScript - Stack Overflow

    Apr 2, 2021 · Interaction of Javascript and PHP. We all grew up knowing that Javascript ran on the Client Side (ie the browser) and PHP was a server side tool (ie the Server side). CLEARLY …

  5. how to write javascript code within php - Stack Overflow

    Nov 19, 2013 · PHP runs on the serverside where there is no javascript engine, the javascript has to be echo'ed to the browser just like HTML, as that is where javascript is executed. As a …

  6. How do I pass JavaScript variables to PHP? - Stack Overflow

    Jul 15, 2016 · Now JavaScript directly interacts with DOM and can manipulate the layout but PHP can't - it needs to refresh the page. The only way is to refresh your page to and pass the …

  7. How to incorporate a PHP-generated value into JavaScript code …

    Jul 28, 2024 · All the explanations above doesn't work if you work with .js files. If you want to parse PHP into .js files, you have to make changes on your server by modfiying the .htaccess …

  8. How do I pass variables and data from PHP to JavaScript?

    Apr 18, 2017 · More readable - JavaScript is JavaScript, PHP is PHP. Without mixing the two, you get more readable code on both languages. Without mixing the two, you get more readable …

  9. Include PHP inside JavaScript (.js) files - Stack Overflow

    Actually the best way to accomplish this is to write the javascript in a .php and use jquery in a separate file to use the Jquery get script file or jquery load use php include function in the doc …

  10. javascript - how to add script inside a php code? - Stack Overflow

    Aug 24, 2010 · <script type="text/javascript"> <?php echo "alert('message');"; ?> </script> If want PHP to generate a custom message for the alert dialog, then basically you want to write your …

Refresh