answersLogoWhite

0

Any communication between Javascript code and PHP code needs to be instigated by the Javascript. This is because Javascript is a client side script and PHP is server side. The server can't force data to the browser; it can only reply to requests.

The technique of using Javascript on the client side to talk to server side scripts is referred to as AJAX (Asynchronous Javascript And XML). There are several libraries available for simplifying it's usage, and many online tutorials.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How can you close the iframe in calling page in php and javascript?

Using JavaScript, you can accomplish this by deleting the iframe node from the DOM.


How do you perform image slideshow in php?

Image Slideshow is very difficult using php. Instead store the image files in an image folder and apply slideshow to them using javascript. Here's a reference to automatic slideshow using javascript: How_do_you_create_slide_show_using_javascript_code


How do you connect sqlserver with HTML?

using php


How do you connect oracle database in javascript?

By using ODBC


How do you pass table values from one page to another using HTML?

You cant you have to use php or javascript.


How do you write a password script using JavaScript in PHP with a form?

This question is too broad, be more specific.


What are the similarities between PHP and JavaScript?

there are not many similarities, except the if and else statements, loops, etc... but PHP talks to the server, JavaScript can't. That's why both languages have totally different functions. If you only use basic JavaScript, PHP doesn't differ too much.


How can you pass a JavaScript value into a PHP file?

JavaScript lives in the browser, PHP lives on the server.To pass a value from JavaScript to a PHP page, you can eitherdo an HTML form submituse AJAXIn both cases, the value is sent to the server and you write your PHP to handle it and send a response.The important thing is that the JavaScript value won't be available in PHP when you first generate the page, creating the page and handling the value submitted from the browser are two distinct steps.


Does JavaScript interact with PHP?

Yes, JavaScript and PHP can interact with each other in web development. JavaScript is a client-side scripting language that runs in a user's browser, while PHP is a server-side language that runs on the server. The two languages can communicate with each other through the use of AJAX (Asynchronous JavaScript and XML) requests. JavaScript can make an AJAX request to a PHP script on the server, and the PHP script can process the request and return data back to the JavaScript code. This allows for dynamic, interactive web pages that can update their content without requiring a full page refresh. Overall, JavaScript and PHP are complementary technologies that can work together to create powerful web applications


How do you create a text editor in PHP?

Well it got nothing to do with PHP, you going to need JavaScript to do that :)


How do you use the JavaScript confirm function in PHP?

It has to be done with Javascript. Though you could do something like this:


What programming language is used for webOS applications?

HTML5, JavaScript, CSS