Co-Authored By:
Asked by: Thorsten Struwe
technology and computing web design and htmlCan we write PHP code inside jQuery?
Just so, can we write php inside javascript?
- PHP is a server side script (Runs at server side) while.
- JavaScript is a client side scripting i.e when a request is made your browser(client) runs the java script.
- executing php inside javascript violates statement 1 so it is impossible to run PHP inside java script however you can do reverse (i.e Javascript inside PHP)
Similarly, can we write PHP code in HTML file?
As you can see, you can use any HTML you want without doing anything special or extra in your PHP file, as long as it's outside and separate from the PHP tags. In other words, if you want to insert PHP code into an HTML file, just write the PHP anywhere you want (so long as they're inside the PHP tags).
AJAX = Asynchronous JavaScript and XML. AJAX is a technique for creating fast and dynamic web pages. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.