如何使用.load()

时间:2013-10-03 06:55:14

标签: jquery url load

我有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

请告诉我这个问题或任何解决方案。感谢的

0 个答案:

没有答案