我有 jquery 的问题。我在我的脚本中使用了 include('somefile.php')
但是当我想从 jquery 加载这个 somefile.php 时不起作用。
这是我的php脚本
<tr>
<td width="35%" valign="top"><?php include('inputform.php');?></td>
<td width="64%" id="listTbl"><div id="List"><?php include('somefile.php');?></div></td>
</tr>
这里是我的 jquery 脚本
$.ajax({
type: 'POST',
url: 'savedata.php',
data: $('form').serialize(),
beforeSend: function() {
$("imgLoad").show();
},
complete: function() {
$("imgLoad").hide();
},
cache: false,
success: function () {
$("#cText1").val('');
$('#imgLoad').hide();
$('.button_blue').attr("disabled", false);
$('#msgConfirm').fadeIn(500).delay(5000).fadeOut(1000);
$("#msgConfirm").html(' Save Success.');
$("#cText1").focus();
$('#listTbl').load("listcategory.php #List >*",function(){
//after loading completion code goes here
});
}
return false;
});
这个 jquery 脚本没有任何负载。页面只是空白。但我尝试不同的方式,如下所示
$('#catListTbl').load("listcategory.php");
我也试过这个
$('#catListTbl').load("listcategory.php");
但是上面的两个短脚本让我出错了。关于数据库无法打开,找不到表的错误,所有的sql命令都会出现如下错误。
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 2
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 2
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 3
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 5
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 5
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 6
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 8
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 8
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 9
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 11
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 11
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 12
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 14
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 14
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\Webserver\Apache2\htdocs\Listing\includes\opentable.php on line 15
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Webserver\Apache2\htdocs\Listing\somefile.php on line 44
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Webserver\Apache2\htdocs\Listing\somefile.php on line 44
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Webserver\Apache2\htdocs\Listing\somefile.php on line 45
请给我这个问题或任何解决方案的建议。谢谢