$.getJSON を使用して、db の最後のレコードのデータを from に入力しようとしています。GET は JSON を返しますが、フィールドに入力するデータを取得できません。私はこれの多くに完全に慣れていません。
$.getJSON("loadloads.php", function (data) {
document.getElementById("LoadNumber").innerHTML = data.LoadNumber
});
これは返された JSON であり、firebug からコピーされます。
[{
"value": {
"LoadNumber": "227303",
"OrderDate": "2013-04-09",
"ShipDate": "2013-04-09",
"ShipTime": "12:00:00",
"DeliveryDate": "2013-04-10",
"DeliveryTime": null,
"PurchaseOrderNumber": "0002323803",
"CustomerId": "200540",
"Rate": "801.08",
"EmployeeId1": "1",
"EmployeeId2": "1",
"CarrierId": "201383",
"CarrierRate": "700",
"Tarp": "NO",
"Status": "Dispatched",
"Notes": "Pls check in as an All Points Inc. carrier. V-boards reg. Shipper tracking we need Proof of delivery faxed or called in A.S.A.P (within 24 hours) Need printed name of person signing for load. Must haul 48K min.",
"LoadTypeId": "1",
"LoadType": "Flatbed",
"BillingNotes": "608.48 + 192.60",
"InvoiceDate": null,
"PayDate": null,
"DestinationNext": null,
"Covered": "0",
"CompanyName": "GAF Materials Corp.",
"CarrierName": "Daniel Zamora",
"FN1": "Craig",
"FN2": "Craig"
}
}]
これは入力ボックスです
<label for="LoadNumber">Load Number :
<input type="text" size="12" id="LoadNumber" Name="LoadNumber" tabindex="-1" />
</label>