Page 1 of 1

Calling PHP from a javascript event.

Posted: Sun Dec 18, 2005 11:38 am
by Longlands
I have a webpage that is created with a combination of HTML/CSS and Javascript.

What I want is to wait for a button to be clicked on the page and then call a php script to pull some content from a MySql database and echo is as a set of radar buttons into a specific position on my page. I have to call the PHP after the button is clicked because some user-input data will be passed from a javascript variable to the php script.

However I don't know how - or even if it is possible - to call a php script from a Javascript onmousedown event. I should add that the onmousedown event is already being checked to do something else in the javascript.

Any ideas? Please? :?

Martin.

Posted: Sun Dec 18, 2005 11:54 am
by Chris Corbyn
Either AJAX, or just use window.location='thescript.php'; ;)

Posted: Mon Dec 19, 2005 9:15 am
by pilau
d11wtq wrote:Either AJAX, or just use window.location='thescript.php'; ;)
What is AJAX? I hear this name everywhere I go

Posted: Mon Dec 19, 2005 9:18 am
by hawleyjr
Asynchronous JavaScript and XML

http://en.wikipedia.org/wiki/AJAX