JqueryとAjaxを使用してJsonデータをテーブルに保存したい.これは私のJsonファイルのようです:-
[
{
"term": "BACCHUS",
"part": "n.",
"definition": "A convenient deity invented by the ancients as an excuse for getting drunk.",
"quote": [
"Is public worship, then, a sin,",
"That for devotions paid to Bacchus",
"The lictors dare to run us in,",
"And resolutely thump and whack us?"
],
"author": "Jorace"
},
{
"term": "BACKBITE",
"part": "v.t.",
"definition": "To speak of a man as you find him when he can't find you."
},
{
"term": "BEARD",
"part": "n.",
"definition": "The hair that is commonly cut off by those who justly execrate the absurd Chinese custom of shaving the head."
}
]
「json」という名前のテーブルがあり、term、part、および definition という名前の 3 つの列があります。現在、json データをこのような html テーブルにロードしています。
$.ajax({
type: "GET",
url: "b.json",
dataType: "json",
success: function (data) {
$.each(data, function (entryIndex, entry) {
// var html = '<div class="declareing_variable">';
var html1 = entry['term'];
var html2 = '<div class="geting_part">' + entry['part'] + '</div>';
var html3 = '<div class="geting_definition">' + entry['definition'] + '</div>';
$('<tr></tr>').html('<th>' + html1 + '</th><th>$' + html2 + '</td><th>$' + html3 + '</th>').appendTo('#json');
$('#abc').append(html2);
});
}
});
どうすればそれをSQLテーブルに保存でき、コーディングのヘルプを提供できますか?