var aircraft = $("#resultdiv");
function ajaxrequest(str){
$.get("other_file.php?icao="+str, function(result){
aircraft.append(result);
});
}
other_file.php
...
<script>
$("#editaircraft")
.find('button') /* ??? */
.click(editForm);
function editForm(){
var icao = document.getElementById('icao').value;
var name = document.getElementById('name').value;
var weightempty = document.getElementById('weightempty').value;
var weightfull = document.getElementById('weightfull').value;
var cargofull = document.getElementById('cargofull').value;
var cruisespeed = document.getElementById('cruisespeed').value;
var range = document.getElementById('range').value;
var price = document.getElementById('price').value;
var firstclassseats = document.getElementById('firstclassseats').value;
var businessclassseats = document.getElementById('businessclassseats').value;
var economyclassseats = document.getElementById('economyclassseats').value;
ajax.open("POST","edit_aircraft_process.php",true);
ajax.onreadystatechange=function(){
if(ajax.readyState==4)
{
refreshTable(function(){$("#loadingdialog").dialog('close');});
refreshTable(function(){$("#result").fadeIn(); document.getElementById("result").innerHTML=ajax.responseText;});
setTimeout(function() { $("#result").fadeOut() }, 5000);
}
}
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send("icao="+icao+"&name="+name+"&weightempty="+weightempty+"&weightfull="+weightfull+"&cargofull="+cargofull+"&cruisespeed="+cruisespeed+"&range="+range+"&price="+price+"&firstclassseats="+firstclassseats+"&businessclassseats="+businessclassseats+"&economyclassseats="+economyclassseats);
$("#editaircraftdialog").dialog('close');
$("#loadingdialog").dialog('open');
}
</script>