dzhax Posted May 1, 2009 Share Posted May 1, 2009 I was wondering if it was possible to place a php script into a java script so it runs when the function is called?and if so how could i request the text in the memo field and place it into a textbox? Link to comment Share on other sites More sharing options...
jlhaslip Posted May 1, 2009 Share Posted May 1, 2009 The technology to have Javascript run a php script is AJAX.Check the Tutorials at w3schools for AJAX tuts. Link to comment Share on other sites More sharing options...
boen_robot Posted May 1, 2009 Share Posted May 1, 2009 I was wondering if it was possible to place a php script into a java script so it runs when the function is called?In the way you describe it, it's not possible. PHP runs before JavaScript, never afterwards.The AJAX technique jlhaslip mentions is really making a new HTTP request with JavaScript. You request a PHP page via HTTP by using JavaScript, PHP generates something upon being called by it, JavaScript gets the response (i.e. the new PHP's output), and then does something with it (like insert it on the page for example). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.