$.post not working on shared server but working locally

$.post not working on shared server but working locally

I have a script that sends some HTML to the server and server saves the HTML as a newsletter. the script works perfectly on my localhost, but, when i put it online, it doesnt. I checked the file permissions, the URL, the php file but nothing solved my problem I have been looking for a solutiin for this problem since last week:


    $.post("newslettersAPI.php",
            {id:newsletterID,templateID:templateID,content:content,subject:subject},
                function(data){
                   
                    //something happens here
            });
  
}