Search code examples
jqueryjquery-1.5

trying to get data from external php file


what's wrong with this code of mine... I'm new to jquery especially 1.5 ver....

function loadQry(str)
{
     $.ajax({
          type: "POST",
          url: "fillpage.php",
          data: "prodcode="+str,
          success: function(response_data){
                     $('s_content').html(response_data)
                   }
          });
}

The problem I have is that, it's not returning any data from the external php. I'm confused..

In 1.4 using XMLHttpRequest I can do it and it's doing fine. but this code certainly bugged me LOT..


Solution

  • 
    function loadPostQry(str) { 
        $.get( 'fillpage.php','prodcode='+str, function(data) { 
            $('#s_content').html(data); 
        },
        "html" ); 
    }
    

    I'm assuming you meant this?