jQuery .ajax()方法

I am new to the jQuery AJAX ajax() Method. I have successfully created the function AddATeacher() which gets called because all the alert messages do popup. However the ajax() Method inside the function does not work. I know this because the addATeacherInsert.php does not load.

I got it to work under firefox, but not on chrome. However it only works in firefox when I have the alert message at the end of the code: alert ("Exiting myJQFunctions...");, otherwise it stops working all together. I would like it to work when I comment out the alert message at the end of the file. How can I solve this?

function AddATeachers()
{
    var tFirstName     = $('#teachers_first_name').attr('value');  
    var tLastName     = $('#teachers_surname').attr('value');  

    alert ("Entering myJQFunctions...");
    alert ("Teachers first name is: " + tFirstName);

    $.ajax({  
       type: "GET",  
       url: "../pgs/addATeacherInsert.php", 
       data: "tFirstName="+ tFirstName +"&tLastName="+ tLastName,  
       success: function(html){$("#Ajax_response").html(html);}  
    });  

    // works well under firefox but shows alert
    // doesnt work at all if commented out.
    alert ("Exiting myJQFunctions...");    
}

You could use the jQuery GET method

function AddATeachers() { 
.get('url/phpPage.php', {tFirstName: $('#teachers_first_name').attr('value'), tLastName: $('#teachers_surname').attr('value')}, function(returnData){
$("#Ajax_response").html(returnData);
});
}

Ajax functions ends only after it gets response from server.

function AddATeachers()
{

    var tFirstName     = $('#teachers_first_name').attr('value');  
    var tLastName     = $('#teachers_surname').attr('value');  

    alert ("Entering myJQFunctions...");
    alert ("Teachers first name is: " + tFirstName);

    $.ajax({  
       type: "GET",  
       url: "../pgs/addATeacherInsert.php?tFirstName="+ tFirstName +"&tLastName="+ tLastName,  
       success: function(html){
          alert(html);                       // alerts the html code returned.
          $("#Ajax_response").html(html);
          alert("Exiting myJQFunctions..."); // Ajax function ends here only.
       }  
   });
}

Answer for ur Question Only

 $.ajax({  
            type: "GET",  
            url: "Enter Full file path", 
            data: "tFirstName="+ tFirstName +"& tLastName="+ tLastName,  
            success: function(html){
                $("#Ajax_response").html(html);}  
        }); 

tyr this dude...