tags:

views:

74

answers:

2

i write following code

     <script type="text/javascript">
        $(document).ready(function() {
        $('#disp').load('index.php', function(){
         $('#lobar').hide();
       });

    });
  </script>

what i need to load index.php on page load in to div named: dis

Thanks

+1  A: 
$(function() {
    $('#disp').load('index.php', {}, function(){
        $('#lobar').hide();
    });
});
Darin Dimitrov
+1  A: 

The load() function takes 3 arguments but you are only passing in 2. Look at the documentation for the load function at this link. I think you want to pass a null as the 2nd parameter to achieve the results you want.

$('#disp').load('index.php', null, function(){
   $('#lobar').hide();
 });
Jason
The second and third params are optional and you may pass the third one without the second param. See source of jQuery library.
Kamarey