Jquery Ajax .load not working

Here is some code using JQuery’s .load:

The following code is not correctly displaying the information though:

 function revDescr(condition_id, rev_cat_id) {
    this.condition_id = condition_id;
    this.rev_cat_id = rev_cat_id;
    
    var pars = 'condition_id='+this.condition_id+'&rev_cat_id='+this.rev_cat_id; //used by jQuery
    $("#reverse_content").load("updateRevDescrSi.php?"+pars);
 }

Here is the comparable Ajax code using regular javascript (i.e. not using JQuery):

The following code is working and the information is properly displayed:

function revDescr(condition_id, rev_cat_id) {
    this.condition_id = condition_id;
    this.rev_cat_id = rev_cat_id;
    
    //update the reverse entry description
    xmlhttp10=GetXmlHttpObject(); //if xmlhttp object not created
    if (xmlhttp10==null) {
        alert ("Browser does not support HTTP Request");
        return;
    }

    var url="./include_ajax/updateRevDescrSi.php";
    url=url+"?condition_id="+this.condition_id;
    url=url+"&rev_cat_id="+this.rev_cat_id;
    url=url+"&sid="+Math.random();
    xmlhttp10.open("GET",url,true);
    xmlhttp10.onreadystatechange=stateChangedRevDescr;

    xmlhttp10.send(null);
}

function stateChangedRevDescr() {
    if (xmlhttp10.readyState==4) {
        var data = xmlhttp10.responseText;
        document.getElementById("reverse_content").innerHTML = data;
    } else  {
        document.getElementById("reverse_content").innerHTML = "Please wait...updating";
    }
}
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Share

You must be logged in to post a comment.