I am writing a script using AJAX in JQuery that takes an action_id from exp_actions as the destination URL for the method I need to execute in my mcp file. The reference is made statically. Can the ACT value be found by making a PHP call in the view in a way similar to:
$aid =$this->EE->cp->fetch_action_id('Class_name', 'method_name');
?
My page currently looks this way:
<script type= "text/javascript">
$(document).ready(function() {
$('form').change(function(e){
var data = $(this).serializeArray();
console.log(data);
$.post(
<? echo'http://ourwebsite.com/ee/admin.php?ACT=44&id=4 ,';?>
data,
function() {
console.log(this);
}
)
});
});
Thanks in advance!