Simple example:
Script with ajax-request (by jQuery lib)
function captchaWork()
{
alert("Check before request");//ok
$.post("check.php",obrabotka);
}
function obrabotka(data)
{
alert("Function obrabotka");
}
Server php-script (check.php)
<?php
echo json_encode('ok');
?>
Problem description: if the php-script is on a local computer (with local apache) everything works fine. But if the php-script is on a hosting, it does not respond to the ajax-request. (although, if I enter path to the script in address field - the script gives the string "ok").
I tried to do different things in order to solve the problem (to change encoding of the files, to change a hosting provider), but all of them don't help.
My question: What can be wrong with my example?
Thank You

New Topic/Question
Reply


MultiQuote






|