简体   繁体   中英

Ajax php file call fails

I had this script working, to replace a target element in the DOM with the content of "sample.html" file:

$('.ajaxtrigger').click(function(){
$('#loading').show();
$('#target').load('sample.html', function() {
$('#loading').hide();
});

After that, I needed to transform sample.html in sample.php because I must call some functions in it. The above script doesn't work now, if a simply replace 'sampe.html' with 'sample.php'..

Ajax doesn't call its content anymore

Have you tried visiting the 'sample.php' page individually? Perhaps you have a syntax error or something more sinister like PHP is not working/installed on your server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM