Getting output of PHP script using JQuery -


i trying load output of php script using javascript , jquery. javascript function using uses $.get function in jquery call php script, want display in division. script wrote is:

<script type="text/javascript"> function on_load() {     $(document).ready(function() {         alert('here');         $.get("http://localhost/dbtest.php", function(data){             alert('here too');             $("uname").html(data);         });     }); }  </script> 

the php script (dbtest.php) uses simple echo statement:

echo "hello, world!!!"; 

i getting first alert here, not second. can doing wrong here?

i suppose uname id, in case should use:

$("#uname").html(data); 

you can add php debugging:

error_reporting(e_all ^ e_notice); ini_set("display_errors", 1);  

try remove http:// ajax call , use relative path instead.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -