Jquery script can't find the file

Viewed 105

I have problem using jquery script. The problem is that It can't find PHP file in Wordpress.

jQuery(function($) {
$('#checkboxtest').change(function(){
    if( $('#checkboxtest').prop('checked') )
       {checkboxstatus = "YES";}
       else
       {checkboxstatus = "NO";}
$.ajax({
        type: "POST",
        url: "checkboxtestbackend.php",
        data: {checkboxstatus: checkboxstatus},
        })
        
});
});

And the problem:

jquery.js?ver=1.12.4-wp:4 POST http://localhost/wordpress/checkboxtestbackend.php 404 (Not Found)
0 Answers
Related