I have an ajax message, but it is canceled. I just created a test.php file that should have the value echo 'test'; .
This is what my ajax script looks like:
function loadAd(date) { var ajax_url = '<?=URL?>components/ajax/grab_ads.php'; $.ajax({ type: 'POST', url: ajax_url, dataType: 'html', data: ({ date : date }), cache: false, success: function(data) { if(data > 0) { $('.advert').fadeIn("fast"); } }, error: function(xhr, textStatus, errorThrown) {
The function is called, I tried to start it. The variable is also transmitted well. This is what I get on the chrome network tab. screenshot
In addition, I am completely helpless.
Edit: I call the function as follows:
$datum = Date("dmY H:i:s"); $adl .= '<script type="text/javascript"> loadAd(\''.$datum.'\'); </script>';
source share