简体   繁体   English

Ajax php文件调用失败

[英]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: 我使用了此脚本,用“ sample.html”文件的内容替换DOM中的目标元素:

$('.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. 之后,我需要在sample.php中转换sample.html,因为我必须在其中调用一些函数。 The above script doesn't work now, if a simply replace 'sampe.html' with 'sample.php'.. 如果仅将“ sampe.html”替换为“ sample.php”,则上述脚本现在无法使用。

Ajax doesn't call its content anymore Ajax不再调用其内容

Have you tried visiting the 'sample.php' page individually? 您是否尝试过单独访问“ sample.php”页面? Perhaps you have a syntax error or something more sinister like PHP is not working/installed on your server. 也许您有语法错误,或者更险恶的东西(例如PHP)无法在您的服务器上运行/安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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