Jump to content

Php In A Javascript?


dzhax

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...