URL がクリップボードにコピーされました!
‘);戻る; } else { jQuery(“#autocomplete-results”).html(”); // 十分な文字が入力されるとメッセージをクリアします } // API リクエストを作成します jQuery.ajax({ url: arAjax.ajaxurl, type: “GET”, dataType: “json”, data: { action: “get_entity”, search: searchQuery, types: “authors”, src: “name”, limit: “10” }, success: function(response) { // デフォルト var htmlContent = “”; // 成功 if (response.status && parseInt(response.status, 10) === 200 && response.result) { // authors if (response.result.authors) { // テーブルの構築を開始します htmlContent += ”;
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; // ループ jQuery.each(response.result.authors, function(index, el) { // 画像またはフラグのフォールバック let image=””; if (el.image && el.image.length > 0) { image=”‘; } else { if (!el.cc || (el.cc && el.cc.length !== 2)) { el.cc=”xx”; } // cc のデフォルトは xx image=”‘; } // 行 htmlContent += ‘
‘; }); // テーブルを閉じる htmlContent += ”; } // 機関を名前で指定します if (response.result.institutions) { // テーブルの構築を開始します htmlContent += ”; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; // ループ jQuery.each(response.result.institutions, function(index, el) { var fullName = el.name; if (el.city) { fullName += ‘, ‘ + el.city; } if (el.state) { fullName += ‘, ‘ + el.state; } if (el.country) { fullName += ‘, ‘ + el.country; } // 画像またはフラグフォールバック let image=””; if (el.image && el.image.length > 0) { image=”‘; } else { if (!el.cc || (el.cc && el.cc.length !== 2)) { el.cc=”xx”; } // cc のデフォルトは xx image=”‘; } // 行 htmlContent += ‘
‘; }); // テーブルを閉じる htmlContent += ”; } // 名前でスポンサーを指定します if (response.result.sponsors) { // テーブルの構築を開始します htmlContent += ”; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; htmlコンテンツ += ‘
‘; // ループ jQuery.each(response.result.sponsors, function(index, el) { // 画像またはフラグのフォールバック let image=””; if (el.image && el.image.length > 0) { image=”‘; } else { if (!el.cc || (el.cc && el.cc.length !== 2)) { el.cc=”xx”; } // cc のデフォルトは xx image=”‘; } // 行 htmlContent += ‘
‘; }); // テーブルを閉じる htmlContent += ”; } } else { htmlContent=”
“; htmlコンテンツ += 応答.メッセージ htmlコンテンツ += ‘
‘; } // jQuery(“#autocomplete-results”).html(htmlContent) を更新します。 }, エラー: function(xhr, ステータス, エラー) { var errorMessage=”
AJAX エラー: ” + xhr.status + ‘ ‘ + xhr.statusText + ‘
‘; jQuery(“#autocomplete-results”).html(errorMessage); } }); }, 300); // 300 ミリ秒のデバウンス時間 }).on(“blur”, function() { if (jQuery(this).val().length
‘ + 値 + ‘
‘ + 統計ラベル + ‘
#Autor #Africa #Research #Connect