{"id":4451,"date":"2016-07-21T10:00:00","date_gmt":"2016-07-21T01:00:00","guid":{"rendered":"http:\/\/inter-arteq.com\/?p=4451"},"modified":"2022-03-23T14:19:33","modified_gmt":"2022-03-23T05:19:33","slug":"how-to-get-access-less-for-incremental-search","status":"publish","type":"post","link":"http:\/\/cms.inter-arteq.com\/how-to-get-access-less-for-incremental-search\/","title":{"rendered":"\u30b5\u30fc\u30d0\u30fc\u8ca0\u8377\u304c\u5c11\u306a\u3044\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u30b5\u30fc\u30c1\u306e\u4f5c\u308a\u65b9"},"content":{"rendered":"\n

\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3059\u308b\u3068\u304d\u3001\u691c\u7d22\u30dc\u30bf\u30f3\u3092\u62bc\u3055\u306a\u304f\u3068\u3082\u3001\u5165\u529b\u3055\u308c\u305f\u6642\u70b9\u3067\u81ea\u52d5\u7684\u306b\u691c\u7d22\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u308b\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u30b5\u30fc\u30c1\u306f\u4eca\u3084\u591a\u304f\u306eWeb\u30b5\u30a4\u30c8\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u30b5\u30fc\u30c1\u3092\u5b9f\u88c5\u3059\u308b\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u304c\u3001change\u30a4\u30d9\u30f3\u30c8\u306f\u4e00\u5ea6\u30d5\u30a9\u30fc\u30ab\u30b9\u3092\u306f\u305a\u3055\u306a\u3044\u3068\u767a\u706b\u3057\u306a\u3044\u306e\u3067\u3001keyup\u3067\u3084\u308b\u3053\u3068\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

\u3057\u304b\u3057\u306a\u304c\u3089\u3053\u306e\u5b9f\u88c5\u65b9\u6cd5\u3067\u306f\u3001\u5165\u529b\u30ad\u30fc\u304c\u62bc\u3055\u308c\u308b\u5ea6\u3001\u901a\u4fe1\u304c\u8d70\u308b\u305f\u3081\u3001\u5fc5\u8981\u4ee5\u4e0a\u306b\u30b5\u30fc\u30d0\u30fc\u306b\u8ca0\u8377\u3092\u304b\u3051\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

\u4eca\u56de\u306f\u5fc5\u8981\u4ee5\u4e0a\u306b\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u706b\u3055\u305b\u306a\u3044\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

\u5bfe\u51e6\u6cd5<\/h2>\n\n\n\n

\u3053\u3053\u3067\u306fjQuery\u3092\u4f7f\u3063\u305f\u4f8b\u3092\u6271\u3044\u307e\u3059\u304c\u3001axios\u306a\u3069\u3092\u4f7f\u3063\u305f\u3068\u304d\u3082\u540c\u69d8\u306e\u51e6\u7406\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n

HTML\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n

<input id="keyword" data-href="\/your\/search\/path"\/>\n<ul id="result-list">\n  <!-- \u3053\u3053\u306b\u7d50\u679c\u304c\u53cd\u6620\u3055\u308c\u308b\u3002 -->\n<\/ul><\/code><\/pre><\/div>\n\n\n\n

\u3053\u3053\u3067\u3001input\u30bf\u30b0\u5185\u306edata-href\u306f\u691c\u7d22\u7d50\u679c\u3092\u8fd4\u3059\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306eURL\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

\u3055\u3066\u3001\u672c\u984c\u306e\u30b5\u30fc\u30d0\u30fc\u306e\u8ca0\u8377\u3092\u6e1b\u3089\u3059\u305f\u3081\u306b\u300c\u30ad\u30fc\u3092\u30bf\u30a4\u30d7\u3057\u305f\u5f8c\u3001\u3057\u3070\u3089\u304f\u5165\u529b\u304c\u306a\u3051\u308c\u3070\u3001Ajax\u3092\u6295\u3052\u308b\u300d\u3068\u3044\u3046\u767a\u60f3\u3067JS\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n

$(function(){\n  var $keyword = $('#keyword');\n  var $resultList = $('#result-list');\n  var url = $keyword.data('href');\n  \/\/ Ajax\u901a\u4fe1\u3092\u884c\u3046\u95a2\u6570\n  function send(){\n    $.ajax({\n      type: 'GET',\n      dataType: 'html',\n      data: {\n        keyword: $keyword.val(),\n        url: url,\n        success: function(data){\n          \/\/ \u901a\u4fe1\u304c\u6210\u529f\u3057\u305f\u3089\u30ea\u30b9\u30c8\u3092\u7dcf\u5165\u308c\u66ff\u3048\n          $resultList.html(data)\n        }\n      }\n    });\n  };\n  var send_timeout_id = null\n  $keyword.on('keyup', function(){\n    \/\/ keyup\u3055\u308c\u305f\u6642\u70b9\u3067\u65e2\u306bsend\u306e\u5b9f\u884c\u304c\u4e88\u7d04\u3055\u308c\u3066\u3044\u305f\u3089\u4e00\u65e6\u524a\u9664\n    if(send_timeout_id){\n      clearTimeout(send_timeout_id);\n    }\n    \/\/ 500ms\u5f8c\u306bsend\u3092\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u4e88\u7d04\n    send_timeout_id = setTimeout(send, 500);\n  }\n});<\/code><\/pre><\/div>\n\n\n\n

\u307e\u3068\u3081<\/h2>\n\n\n\n

Ajax\u3092\u4f7f\u3046\u3068UX\u7684\u306b\u306f\u3044\u3044\u3082\u306e\u306b\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u304c\u3001\u4e0a\u624b\u304f\u3084\u3089\u306a\u3044\u3068\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u7121\u99c4\u306a\u8ca0\u8377\u3092\u304b\u3051\u3066\u3057\u307e\u3044\u3001\u8868\u793a\u304c\u9045\u304f\u306a\u308b\u306a\u3069\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30b9\u30c8\u30ec\u30b9\u306b\u3064\u306a\u304c\u308a\u304b\u306d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n

\u3044\u3064\u3001\u3069\u306e\u304f\u3089\u3044\u306e\u983b\u5ea6\u3067\u901a\u4fe1\u304c\u884c\u308f\u308c\u308b\u306e\u304b\u3057\u3063\u304b\u308a\u610f\u8b58\u3057\u306a\u304c\u3089\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u6c17\u6301\u3061\u3088\u304f\u4f7f\u3048\u308b\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3059\u308b\u3068\u304d\u3001\u691c\u7d22\u30dc\u30bf\u30f3\u3092\u62bc\u3055\u306a\u304f\u3068\u3082\u3001\u5165\u529b\u3055\u308c\u305f\u6642\u70b9\u3067\u81ea\u52d5\u7684\u306b\u691c\u7d22\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u308b\u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u30b5\u30fc\u30c1\u306f\u4eca\u3084\u591a\u304f\u306eWeb\u30b5\u30a4\u30c8\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u30a4\u30f3\u30af\u30ea\u30e1\u30f3\u30bf\u30eb\u30b5\u30fc\u30c1\u3092\u5b9f\u88c5\u3059\u308b\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e […]<\/p>\n","protected":false},"author":1,"featured_media":208536,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5],"tags":[43,44],"class_list":["post-4451","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-program","tag-javascript","tag-jquery"],"aioseo_notices":[],"jetpack_featured_media_url":"http:\/\/cms.inter-arteq.com\/wp-content\/uploads\/2022\/03\/img_7705.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4451"}],"collection":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/comments?post=4451"}],"version-history":[{"count":6,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4451\/revisions"}],"predecessor-version":[{"id":208542,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/posts\/4451\/revisions\/208542"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media\/208536"}],"wp:attachment":[{"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/media?parent=4451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/categories?post=4451"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/cms.inter-arteq.com\/wp-json\/wp\/v2\/tags?post=4451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}