Jump to content

How to Avoid Postback on JQuery Button click in PHP


fanboime

Recommended Posts

 

	$( "#button" ).click(function( event ) {
	<?PHP
	...
	?>

 

PHP is executed on the SERVER before the page gets to the user. It is not possible to execute PHP code directly from JavaScript. You would have to use AJAX to send a request to the server to execute some PHP code.

PHP is executed on the SERVER before the page gets to the user. It is not possible to execute PHP code directly from JavaScript. You would have to use AJAX to send a request to the server to execute some PHP code.

Can you please give a tutorial?

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.