0

I am trying to load a div of my php page by using a code

$('#show_contractor').load('display_cont.php');

But, I can't able to load and during running that whole div table data are invisible. After refreshing the whole page only, i will get the data. Can you people help me? Thanks in advance.

Sahithya
  • 45
  • 9
  • Check your console for errors. – rrk Mar 02 '16 at 05:05
  • This much info is not enough to help you. Can you share 1) your relevant markup 2) response from php file – gurvinder372 Mar 02 '16 at 05:06
  • `$('#show_contractor').load('display_cont.php', function (responseText, textStatus, req) { if (textStatus == "error") { alert(textStatus); } });` try to add this. then check if you are getting any alert. – rrk Mar 02 '16 at 05:06
  • Yeah! I added this code. But i didnt get any alert. – Sahithya Mar 02 '16 at 05:08
  • Try to decode this like: _I can't able to load and during running that whole div table data are invisible. After refreshing the whole page only, i will get the data._ – Rayon Mar 02 '16 at 05:10
  • My code is, I am adding a user. So if i click assign button, My data should entered into database and only the display table should be loaded instead of loading the whole page. This is my div "
    "
    – Sahithya Mar 02 '16 at 05:13
  • You should look into output buffering. An example can be found here http://stackoverflow.com/questions/4401949/whats-the-use-of-ob-start-in-php .. The content will be stored into `$output`. You generate your full HTML that you can `echo` out. – Daniel Mar 02 '16 at 06:43
  • Thank you. I will work it out. – Sahithya Mar 07 '16 at 09:31

0 Answers0