Jquery button onclick run controller action

Can anyone provide a simple example of running a controller action in the background when a button is clicked.

eg: when this is clicked:

<button onclick="startprocess">Start</button>




If U got U right, what U need is ajax .

How? I need a example.

here you go

<button id="myButton">Click here</button>

<div id="content"></div>


// when you click on the button it will load the action response in "content" div

$("document").ready(function() {

    $("#myButton").click(function() {





How i call the function:


hi .what do you mean??

Here is an other example

<button id="startprocess">Start</button>


$("document").ready(function() {

&#036;(&quot;#startprocess&quot;).click(function() {


		type: &quot;POST&quot;,

		url: &quot;site/StartScript&quot;, //it will call &#036;this-&gt;actionStartScript('') and site is the controller name

		data: { name: &quot;John&quot;, location: &quot;Boston&quot; }


	.done(function( msg ) {

	alert( &quot;Data Saved: &quot; + msg );





I try to execute but the method $this->actionStartScript(‘’) is not executed. O controller this method is Filial1Controller.