Note that there are some explanatory texts on larger screens.

plurals
  1. POHow use .load()
    primarykey
    data
    text
    <p>I have problem with jquery. I have use include('somefile.php') in my script</p> <p>But when i want load this somefile.php from jquery not working.</p> <p>Here my php script</p> <pre><code>&lt;tr&gt; &lt;td width="35%" valign="top"&gt;&lt;?php include('inputform.php');?&gt;&lt;/td&gt; &lt;td width="64%" id="listTbl"&gt;&lt;div id="List"&gt;&lt;?php include('somefile.php');?&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; </code></pre> <p>And here my jquery script</p> <pre><code>$.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 &gt;*",function(){ //after loading completion code goes here }); } return false; }); </code></pre> <p>This jquery script have nothing load. Page just blank. But i try different way like below</p> <pre><code>$('#catListTbl').load("listcategory.php"); </code></pre> <p>and i've try this one too</p> <pre><code>$('#catListTbl').load("listcategory.php"); </code></pre> <p>But 2 of above short script let me in got error. Error about database cannot be open, table not found, all sql command will be error like below.</p> <pre><code>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 </code></pre> <p>Please give me advise for this problem or any solution. Thank's</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload