{"id":2697,"date":"2019-05-17T10:00:30","date_gmt":"2019-05-17T06:30:30","guid":{"rendered":"http:\/\/amuzeshtak.com\/blog\/?p=2697"},"modified":"2020-04-04T07:02:13","modified_gmt":"2020-04-04T03:32:13","slug":"ajax-with-jquery","status":"publish","type":"post","link":"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/","title":{"rendered":"\u0627\u06cc\u062c\u06a9\u0633 (Ajax) \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc"},"content":{"rendered":"<p>\u0627\u06cc\u062c\u06a9\u0633 \u06cc\u0627 Ajax (<a href=\"https:\/\/amuzeshtak.com\/course-category\/web\/javascript\/\">\u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a<\/a> \u0648 XML \u0622\u0633\u0646\u06a9\u0631\u0648\u0646 \/ Asynchronous JavaScript and XML) \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u06cc\u06a9 \u0631\u0648\u0634 \u0633\u0627\u062e\u062a \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062a\u0639\u0627\u0645\u0644\u06cc \u0648\u0628 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0644\u0627\u0641\u0627\u0635\u0644\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u067e\u0631\u062f\u0627\u0632\u0634 \u0645\u06cc \u06a9\u0646\u0646\u062f.(\u062a\u0648\u0635\u06cc\u0647 \u0645\u06cc \u0634\u0648\u062f\u00a0<a href=\"https:\/\/amuzeshtak.com\/courses\/wordpress-theme-design-tutorial-package\/\" target=\"_blank\" rel=\"noopener\">\u062f\u0648\u0631\u0647 \u0622\u0645\u0648\u0632\u0634\u06cc \u0637\u0631\u0627\u062d\u06cc \u0633\u0627\u06cc\u062a<\/a> \u0648 <a href=\"https:\/\/amuzeshtak.com\/courses\/wordpress-theme-design-tutorial-package\/\" target=\"_blank\" rel=\"noopener\">\u067e\u06a9\u06cc\u062c \u0622\u0645\u0648\u0632\u0634 \u0637\u0631\u0627\u062d\u06cc \u0633\u0627\u06cc\u062a<\/a>\u00a0 \u0631\u0627 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f)<\/p>\n<p>\u0647\u0646\u06af\u0627\u0645\u06cc \u06a9\u0647 \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u06cc\u06a9 \u0639\u0645\u0644 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc \u062f\u0647\u062f\u060c Ajax \u0628\u0647 \u0645\u062d\u062a\u0648\u0627 \u062f\u0631 \u0635\u0641\u062d\u0627\u062a \u0648\u0628 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc \u062f\u0647\u062f \u062a\u0627 \u0628\u0644\u0627\u0641\u0627\u0635\u0644\u0647 \u0628\u0647 \u0631\u0648\u0632 \u0631\u0633\u0627\u0646\u06cc \u0634\u0648\u062f\u060c \u0628\u0631 \u062e\u0644\u0627\u0641 \u062f\u0631\u062e\u0648\u0627\u0633\u062a HTTP\u060c \u06a9\u0647 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0628\u0627\u06cc\u062f \u0628\u0631\u0627\u06cc \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u06a9\u0627\u0645\u0644 \u06cc\u06a9 \u0635\u0641\u062d\u0647 \u0635\u0628\u0631 \u06a9\u0646\u0646\u062f. \u0627\u06cc\u062c\u06a9\u0633 \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0641\u0642\u0637 \u06cc\u06a9 \u0642\u0633\u0645\u062a \u0627\u0632 \u0635\u0641\u062d\u0647 \u0648\u0628 \u0631\u0627 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0628\u0642\u06cc\u0647 \u0622\u0646\u060c \u062a\u062d\u062a \u062a\u0627\u062b\u06cc\u0631 \u0642\u0631\u0627\u0631 \u0646\u0645\u06cc \u06af\u06cc\u0631\u062f. \u0646\u0642\u0634\u0647 \u06cc Google map \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 \u06cc \u0645\u0634\u0647\u0648\u0631 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0627\u06cc\u062c\u06a9\u0633 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2698\" src=\"http:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/1-7.png\" alt=\"\u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc\" width=\"500\" height=\"192\" srcset=\"https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/1-7.png 500w, https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/1-7-300x115.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<h2>\u0627\u06cc\u062c\u06a9\u0633 \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc<\/h2>\n<p>ajax.$ \u0634\u0628\u06cc\u0647 \u0628\u0647 XML Http Request \u00a0\u062f\u0631 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\u060c object.$\u060c \u0627\u0633\u062a\u061b \u0627\u0645\u0627 \u0627\u06cc\u062c\u06a9\u0633 \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0633\u0627\u062f\u0647 \u062a\u0631 \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646\u060c \u0622\u0633\u0627\u0646 \u062a\u0631 \u0627\u0632 XMLHttpRequest \u0627\u0633\u062a.<\/p>\n<p>\u0631\u0648\u0634 $.ajax \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u062f\u0627\u0631\u0627\u06cc \u0686\u0646\u062f\u06cc\u0646 \u0648\u06cc\u0698\u06af\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0639\u0628\u0627\u0631\u062a\u0633\u062a \u0627\u0632:<\/p>\n<p>url: \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0631\u0627 \u0628\u0647 \u06a9\u062c\u0627 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u062f. \u0622\u062f\u0631\u0633 url \u0628\u0627\u06cc\u062f \u062f\u0631 \u062f\u0627\u062e\u0644 \u062f\u0627\u0645\u0646\u0647 \u06cc \u0634\u0645\u0627 \u0628\u0627\u0634\u062f.<\/p>\n<p>type: \u0646\u0648\u0639 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0645\u0627\u0646\u0646\u062f: POST \u0648 GET<\/p>\n<p>dataType: \u0646\u0648\u0639 \u062f\u0627\u062f\u0647 \u0627\u06cc \u06a9\u0647 \u062f\u0631 \u067e\u0627\u0633\u062e \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0645\u0627\u0646\u0646\u062f: html\u060c json\u060c xml<\/p>\n<p>data: \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u0631\u0633\u0627\u0644 \u0634\u0648\u0646\u062f.<\/p>\n<p>success: \u0627\u06af\u0631 \u067e\u0627\u0633\u062e \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u062f\u0631\u06cc\u0627\u0641\u062a \u06a9\u0631\u062f\u06cc\u062f\u060c \u067e\u0633 \u0627\u0632 \u0622\u0646 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0628\u0627 \u0622\u0646 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a\u06cc \u0686\u0647 \u06a9\u0627\u0631\u06cc \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f.<\/p>\n<p>complete: \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u06cc\u0627 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0631\u0627 \u0628\u0647 \u06a9\u062f \u067e\u0627\u0633\u062e \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u06a9\u0646\u062f. \u0632\u06cc\u0631\u0627\u060c \u062e\u0627\u0631\u062c \u0627\u0632 \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u06cc\u0627 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a\u060c \u06a9\u062f \u0628\u0627 \u0645\u062d\u062a\u0648\u0627\u06cc \u067e\u0627\u0633\u062e \u0627\u06cc\u062c\u06a9\u0633 \u060c \u06a9\u0627\u0631 \u0646\u0645\u06cc \u06a9\u0646\u062f.<\/p>\n<p>Error: \u0627\u06af\u0631 \u062e\u0637\u0627\u06cc\u06cc \u0631\u062e \u062f\u0647\u062f\u060c \u0627\u06cc\u0646 \u06a9\u062f \u0627\u062c\u0631\u0627 \u0645\u06cc \u0634\u0648\u062f. \u0645\u0639\u0645\u0648\u0644\u0627\u060c \u0627\u06cc\u0646 \u06a9\u062f\u060c \u062a\u0627\u0628\u0639 anonymous \u0631\u0627 \u0645\u06cc \u06af\u06cc\u0631\u062f \u0648 \u0627\u0648\u0644\u064a\u0646 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0645\u0631\u0628\u0648\u0637 \u0628\u0647 \u0622\u0646\u060c \u0634\u064a\u0621 \u0627\u0633\u062a\u060c \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062f\u0648\u0645\u060c \u0648\u0636\u0639\u064a\u062a \u0627\u0633\u062a\u060c \u0648 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0633\u0648\u0645\u060c \u067e\u0627\u0633\u062e \u0645\u062a\u0646\u064a \u0627\u0633\u062a.<\/p>\n[vc_row][\/vc_row][vc_column][\/vc_column][vc_message message_box_style=&#8221;outline&#8221; message_box_color=&#8221;alert-info&#8221; icon_fontawesome=&#8221;fa fa-video-camera&#8221;]\u0622\u0645\u0648\u0632\u0634 \u067e\u06cc\u0634\u0646\u0647\u0627\u062f\u06cc \u0628\u0631\u0627\u06cc \u0634\u0645\u0627 : <a href=\"http:\/\/amuzeshtak.com\/courses\/jquery-tutorial-from-scratch-to-advanced\/\" target=\"_blank\" rel=\"noopener\">\u0622\u0645\u0648\u0632\u0634 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc (jquery) \u0627\u0632 \u0645\u0642\u062f\u0645\u0627\u062a\u06cc \u062a\u0627 \u067e\u06cc\u0634\u0631\u0641\u062a\u0647<\/a><br \/>\n[\/vc_message]\n<p>\u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 index.php \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t&lt;!doctype html&gt;\r\n\u06f2\t&lt;html&gt;\r\n\u06f3\t&lt;head&gt;\r\n\u06f4\t&lt;meta charset=\"utf-8\"&gt;\r\n\u06f5\t&lt;title&gt;Ajax search&lt;\/title&gt;\r\n\u06f6\t&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\"css\/style.css\"&gt;\r\n\u06f7\t&lt;\/head&gt;\r\n\u06f8\t \r\n\u06f9\t&lt;body&gt;\r\n\u06f1\u06f0\t&lt;input type=\"text\" name=\"film_title\" id=\"title\" placeholder=\"type film title\"&gt;&lt;span id=\"total\"&gt;&lt;\/span&gt;\r\n\u06f1\u06f1\t&lt;hr&gt;\r\n\u06f1\u06f2\t&lt;div id=\"result\"&gt;\r\n\u06f1\u06f3\t \r\n\u06f1\u06f4\t&lt;\/div&gt;\r\n\u06f1\u06f5\t&lt;script type=\"text\/javascript\" src=\"http:\/\/code.jquery.com\/jquery-1.10.2.min.js\"&gt;&lt;\/script&gt;\r\n\u06f1\u06f6\t&lt;script type=\"text\/javascript\" src=\"js\/ajaxMethod.js\"&gt;&lt;\/script&gt;\r\n\u06f1\u06f7\t&lt;\/body&gt;\r\n\u06f1\u06f8\t&lt;\/html&gt;\r\n<\/pre>\n<p>\u0648 \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 ajaxMethod.js \u062f\u0631 \u067e\u0648\u0634\u0647 js \u062e\u0648\u062f \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t$(document).ready(function(e) {\r\n\u06f2\t$('#title').on('keyup', function() {\r\n\u06f3\tvar filmName = $(this).val();\r\n\u06f4\t$.ajax({\r\n\u06f5\turl: 'process.php',\r\n\u06f6\ttype: 'POST',\r\n\u06f7\tdataType: \"html\",\r\n\u06f8\tdata: {title: filmName},\r\n\u06f9\tsuccess: function(data) {\r\n\u06f1\u06f0\t \r\n\u06f1\u06f1\t$('#result').html(data);\r\n\u06f1\u06f2\t},\r\n\u06f1\u06f3\tcomplete: function() {\r\n\u06f1\u06f4\tvar count = 0;\r\n\u06f1\u06f5\t$('h3').each(function() {\r\n\u06f1\u06f6\tcount++\r\n\u06f1\u06f7\t})\r\n\u06f1\u06f8\t$('#total').text(count + ' result found');\r\n\u06f1\u06f9\t}\r\n\u06f2\u06f0\t});\/\/end of ajax method\r\n\u06f2\u06f1\t});\/\/end of on key up method\r\n\u06f2\u06f2\t});\/\/end of ready method\r\n<\/pre>\n<h3>\u0634\u0631\u062d \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc:<\/h3>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u062c\u0627 \u0627\u0632 \u0631\u0648\u06cc\u062f\u0627\u062f keyup \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645. \u062f\u0631 \u062f\u0627\u062e\u0644 \u0627\u06cc\u0646 \u0631\u0648\u06cc\u062f\u0627\u062f\u060c \u0645\u0642\u062f\u0627\u0631 \u0641\u06cc\u0644\u062f \u0648\u0631\u0648\u062f\u06cc \u0631\u0627 \u0645\u06cc \u06af\u06cc\u0631\u06cc\u0645. \u067e\u0633 \u0627\u0632 \u0622\u0646\u060c \u0631\u0648\u0634 \u0627\u06cc\u062c\u06a9\u0633 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0631\u0627 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0627\u0648\u0644\u06cc\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645 \u0648 \u06cc\u06a9 \u0634\u06cc \u0631\u0627 \u062f\u0631 \u062f\u0627\u062e\u0644 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0631\u0648\u0634 ajax \u0645\u06cc \u06af\u0630\u0627\u0631\u06cc\u0645. \u0627\u06cc\u0646 \u0634\u06cc\u060c \u0628\u0639\u0636\u06cc \u0627\u0632 \u06a9\u0644\u06cc\u062f \u0647\u0627\u06cc \u0645\u0634\u062e\u0635 \u0634\u062f\u0647 \u06a9\u0647 \u0642\u0628\u0644\u0627 \u062f\u0631 \u0628\u0627\u0644\u0627 \u0628\u062d\u062b \u0634\u062f\u0647 \u0627\u0646\u062f \u0631\u0627 \u062f\u0627\u0631\u0627 \u0627\u0633\u062a. \u062f\u0631 \u0622\u062f\u0631\u0633 url\u060c \u0646\u0627\u0645 \u0635\u0641\u062d\u0647 \u0627\u06cc \u0631\u0627 \u06a9\u0647 \u062f\u0631 \u0622\u0646 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u0634\u0648\u062f\u060c \u0627\u0631\u0627\u0626\u0647 \u0645\u06cc \u062f\u0647\u06cc\u0645. \u067e\u0633 \u0627\u0632 \u0622\u0646\u060c \u0646\u0648\u0639 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0631\u0627 \u06a9\u0647 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u0627\u0631\u0633\u0627\u0644 \u06a9\u0646\u06cc\u0645\u060c GET \u06cc\u0627 POST \u0631\u0627 \u0645\u0634\u062e\u0635 \u0645\u06cc \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u062f\u0631 \u0648\u06cc\u0698\u06af\u06cc \u0646\u0648\u0639 \u062a\u0639\u0631\u06cc\u0641 \u0634\u062f\u0647 \u0627\u0633\u062a. \u0646\u0648\u0639 \u062f\u0627\u062f\u0647 \u0627\u06cc \u06a9\u0647 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u067e\u0627\u0633\u062e \u0627\u0632 \u0622\u062f\u0631\u0633 url \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0634\u062f\u0647 \u0627\u0633\u062a \u0645\u0634\u062e\u0635 \u0645\u06cc \u0634\u0648\u062f \u06a9\u0647 \u062f\u0631 dataType \u062a\u0639\u0631\u06cc\u0641 \u0634\u062f\u0647 \u0627\u0633\u062a. \u0627\u0637\u0644\u0627\u0639\u0627\u062a\u06cc \u06a9\u0647 \u0628\u0647 url \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u0634\u0648\u062f (\u0645\u0627\u0646\u0646\u062f POST\u0640$\u00a0 \u06cc\u0627 GET\u0640$) \u062f\u0631 \u0648\u06cc\u0698\u06af\u06cc \u062f\u0627\u062f\u0647 \u062a\u0639\u0631\u06cc\u0641 \u0634\u062f\u0647 \u0627\u0633\u062a. \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0641\u0642\u0637 \u06cc\u06a9 \u0645\u062a\u063a\u06cc\u0631 \u0627\u0631\u0633\u0627\u0644 \u0634\u062f\u0647 \u0627\u0633\u062a \u0648 \u0622\u0646 \u0639\u0646\u0648\u0627\u0646 \/ title \u0627\u0633\u062a.<\/p>\n<p>\u0628\u0647 \u06cc\u0627\u062f \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f\u060c \u06a9\u0644\u06cc\u062f\u0650 \u0627\u06cc\u0646 \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc\u060c \u0634\u0627\u062e\u0635 \u0622\u0631\u0627\u06cc\u0647 \u06cc \u0645\u062a\u063a\u06cc\u0631 POST\u0640$\u00a0 \u06cc\u0627 GET\u0640$ \u0627\u0633\u062a\u061b \u0645\u0627\u0646\u0646\u062f: POST [&#8216;title&#8217;]\u0640$. \u0648 \u0628\u062e\u0634 \u062f\u0648\u0645\u060c \u0645\u0642\u062f\u0627\u0631 \u0622\u0646 \u0627\u0633\u062a.<\/p>\n<p>\u0645\u0642\u062f\u0627\u0631 \u0686\u0646\u062f\u06af\u0627\u0646\u0647 \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646 \u0628\u0627 \u0646\u0648\u0634\u062a\u0646 \u06a9\u0627\u0645\u0627 \u067e\u0633 \u0627\u0632 \u06cc\u06a9 \u062c\u0641\u062a \u0627\u0632 \u0622\u0646 \u0647\u0627\u060c \u0627\u0631\u0633\u0627\u0644 \u06a9\u0631\u062f. \u0622\u0631\u0627\u06cc\u0647 \u06a9\u0644\u06cc \u0646\u06cc\u0632 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u062a\u0646\u0647\u0627 \u0628\u0627 \u062f\u0627\u062f\u0646 \u0646\u0627\u0645 \u0622\u0631\u0627\u06cc\u0647 \u062f\u0631 \u0648\u06cc\u0698\u06af\u06cc \u062f\u0627\u062f\u0647 \u0627\u0631\u0633\u0627\u0644 \u0634\u0648\u062f\u060c \u0648 \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631\u060c \u0646\u06cc\u0627\u0632\u06cc \u0628\u0647 \u06a9\u0644\u06cc\u062f \u06cc\u0627 \u0645\u0642\u062f\u0627\u0631 \u0646\u06cc\u0633\u062a. \u06a9\u0644\u06cc\u062f \u0622\u0631\u0627\u06cc\u0647\u060c \u06a9\u0644\u06cc\u062f \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f \u0648 keys value\u060c \u0645\u0642\u062f\u0627\u0631 \u06a9\u0644\u06cc\u062f\u06cc \u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u06af\u0644\u0648\u0628\u0627\u0644\u0650 POST\u0640$\u00a0 \u06cc\u0627 GET\u0640$ \u062f\u0631 \u0635\u0641\u062d\u0647 \u06cc \u067e\u0631\u062f\u0627\u0632\u0634 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f.<\/p>\n<p>\u062f\u0631 \u0635\u0648\u0631\u062a \u06a9\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u060c \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0628\u0627\u0634\u062f\u060c \u062a\u0627\u0628\u0639 Success \u062f\u0627\u062f\u0647 \u0647\u0627 \u0631\u0627 \u0627\u0632 \u0622\u062f\u0631\u0633 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0634\u062f\u0647\u060c \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc \u06a9\u0646\u062f. \u062f\u0631 \u0627\u06cc\u0646 \u062c\u0627 \u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062a\u0627\u0628\u0639 anonymous\u060c \u062f\u0631 \u0648\u0627\u0642\u0639 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u067e\u0627\u0633\u062e \u0627\u0633\u062a.<\/p>\n<p>\u062f\u0631 \u0648\u06cc\u0698\u06af\u06cc complete\u060c \u0634\u0645\u0627\u0631\u0634 \u0645\u06cc \u0634\u0648\u062f \u06a9\u0647 \u0686\u0646\u062f \u0646\u062a\u06cc\u062c\u0647\u060c \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u067e\u0627\u0633\u062e \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0622\u0645\u062f\u0647 \u0627\u0633\u062a.<\/p>\n<p>\u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0633\u0631\u06af\u0631\u0645\u06cc\u060c \u06cc\u06a9 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u062f \u0648 \u0641\u0627\u06cc\u0644 file_text.sql \u0631\u0627 \u062f\u0631 \u0622\u0646 \u0648\u0627\u0631\u062f \u06a9\u0646\u06cc\u062f. \u0646\u062a\u06cc\u062c\u0647 \u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631\u060c \u0627\u06cc\u062c\u0627\u062f \u06cc\u06a9 \u062c\u062f\u0648\u0644 film_text \u062e\u0648\u0627\u0647\u062f \u0628\u0648\u062f.<\/p>\n<p>\u06cc\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0627 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u06cc \u062e\u0648\u062f \u06a9\u0627\u0631 \u06a9\u0646\u06cc\u062f. \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646 \u06a9\u0627\u0631\u060c \u0646\u0627\u0645 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0648 \u062c\u062f\u0648\u0644 \u0647\u0645\u0631\u0627\u0647 \u0628\u0627 sql query \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u06cc\u062f.<\/p>\n<p>\u06a9\u062f \u0647\u0627\u06cc \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 connection.php \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t&lt;?php\r\n\u06f2\t \r\n\u06f3\t$dsn = 'mysql:dbname=entertainment;host=127.0.0.1';\r\n\u06f4\t$user = 'root';\r\n\u06f5\t$password = '';\r\n\u06f6\t \r\n\u06f7\ttry {\r\n\u06f8\t$dbh = new PDO($dsn, $user, $password);\r\n\u06f9\t} catch (PDOException $e) {\r\n\u06f1\u06f0\techo 'Connection failed: ' . $e-&gt;getMessage();\r\n\u06f1\u06f1\t}\r\n<\/pre>\n<p>\u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 process.php \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t&lt;?php\r\n\u06f2\t\/\/grab data from index.php page\r\n\u06f3\t$film_title = htmlspecialchars($_POST['title'], ENT_QUOTES);\r\n\u06f4\t$query = $dbh-&gt;prepare(\"SELECT * FROM film_text WHERE title LIKE '$film_title%' LIMIT 10\");\r\n\u06f5\t$query-&gt;execute();\r\n\u06f6\twhile ($finfo = $query-&gt;fetch(PDO::FETCH_OBJ)) {\r\n\u06f7\techo '&lt;div&gt;&lt;h3&gt;' . $finfo-&gt;title . '&lt;\/h3&gt;';\r\n\u06f8\techo '&lt;p&gt;' . $finfo-&gt;description . '&lt;\/p&gt;&lt;\/div&gt;';\r\n\u06f9\t}\r\n\u06f1\u06f0\t?&gt;\r\n<\/pre>\n<h3>\u0634\u0631\u062d \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc:<\/h3>\n<p>\u0628\u062e\u0634\u0650 \u0627\u0628\u062a\u062f\u0627\u06cc\u06cc\u060c \u0627\u062a\u0635\u0627\u0644 \u067e\u0627\u06cc\u06af\u0627\u0647 \u062f\u0627\u062f\u0647 \u0627\u0632 \u0637\u0631\u06cc\u0642 PDO (php database object) \u0627\u0633\u062a. \u0645\u0648\u0627\u0631\u062f \u062f\u06cc\u06af\u0631\u06cc \u0646\u06cc\u0632 \u0645\u06cc \u062a\u0648\u0627\u0646\u0646\u062f \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0634\u0648\u0646\u062f\u060c \u0627\u0632 \u062c\u0645\u0644\u0647: \u06a9\u0644\u0627\u0633 mysqli\u060c \u0627\u0633\u062a\u0627\u06cc\u0644 \u0631\u0648\u06cc\u0647 \u0627\u06cc mysqli. \u0627\u0646\u062a\u062e\u0627\u0628 \u0627\u06cc\u0646 \u0645\u0648\u0627\u0631\u062f \u0628\u0647 \u062a\u0648\u0633\u0639\u0647 \u062f\u0647\u0646\u062f\u0647 \u0628\u0633\u062a\u06af\u06cc \u062f\u0627\u0631\u062f \u06a9\u0647 \u06a9\u062f\u0627\u0645 \u0646\u0648\u0639 \u0627\u062a\u0635\u0627\u0644 \u0631\u0627 \u062a\u0631\u062c\u06cc\u062d \u0645\u06cc \u062f\u0647\u062f.<\/p>\n<p>\u062f\u0631\u0648\u0646 \u0644\u0648\u067e\u0650 while\u060c \u0645\u062a\u063a\u06cc\u0631 i\u060c \u0628\u0627\u06a9\u0633 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0631\u0627 \u06a9\u0647 \u0628\u0627 div \u0633\u0627\u062e\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a\u060c \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc \u06a9\u0646\u062f. \u0627\u06af\u0631 \u06f1\u06f0 \u0646\u062a\u06cc\u062c\u0647 \u067e\u06cc\u062f\u0627 \u0634\u0648\u062f\u060c \u067e\u0633 \u06f1\u06f0 div \u0627\u06cc\u062c\u0627\u062f \u062e\u0648\u0627\u0647\u062f \u0634\u062f \u0648 \u0628\u0647 index.php \u062f\u0631 \u062a\u0627\u0628\u0639 success property anonymous \u0627\u0631\u0633\u0627\u0644 \u0645\u06cc \u0634\u0648\u062f.<\/p>\n<h2>\u0645\u062a\u062f\u0650 \u067e\u0633\u062a \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc<\/h2>\n<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-2699\" src=\"http:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/2-7.png\" alt=\"\u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc\" width=\"500\" height=\"157\" srcset=\"https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/2-7.png 500w, https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/2-7-300x94.png 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><strong>$.post()<\/strong> \u0648 <strong>$get()<\/strong> \u0648 <strong>$.getJSON()<\/strong>\u060c \u0641\u0631\u0632\u0646\u062f\u0627\u0646\u0650 \u0645\u062a\u062f\u0650 <strong>$.ajax()<\/strong> \u0647\u0633\u062a\u0646\u062f. \u0647\u0645\u0647 \u0627\u06cc\u0646 \u0645\u062a\u062f \u0647\u0627 \u0628\u0627 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u0645\u062a\u062f $.ajax \u0628\u0647 \u0637\u0648\u0631 \u062f\u0627\u062e\u0644\u06cc \u06a9\u0627\u0631 \u0645\u06cc \u06a9\u0646\u0646\u062f. \u0627\u06cc\u0646 \u0633\u0647 \u0645\u0648\u0631\u062f\u060c \u0633\u06cc\u0646\u062a\u06a9\u0633 \u0645\u06cc\u0627\u0646 \u0628\u0631 \/\u00a0 short cut \u0628\u0647 \u0645\u062a\u062f $.ajax \u0647\u0633\u062a\u0646\u062f.<\/p>\n<p>\u0633\u06cc\u0646\u062a\u06a9\u0633 $.post() \u00a0\u0648<strong>$.get()<\/strong>\u00a0 \u0645\u0634\u0627\u0628\u0647 \u0647\u0633\u062a\u0646\u062f.<\/p>\n<p>\u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0627\u0648\u0644: URL<\/p>\n<p>\u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u062f\u0648\u0645: \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0628\u0631\u0627\u06cc url \u0645\u0648\u0631\u062f \u0646\u0638\u0631 \u0641\u0631\u0633\u062a\u0627\u062f\u0647 \u0645\u06cc \u0634\u0648\u0646\u062f. \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u06cc\u06a9 \u0622\u0631\u0627\u06cc\u0647 \u062a\u06a9\u06cc \u06cc\u0627 \u06cc\u06a9 \u0634\u06cc \u0645\u0627\u0646\u0646\u062f {key: value\u060c key: value} \u0631\u0627 \u062f\u0631 \u0646\u0638\u0631 \u0628\u06af\u06cc\u0631\u06cc\u062f.<\/p>\n<p>\u067e\u0627\u0631\u0627\u0645\u062a\u0631 \u0633\u0648\u0645: \u062a\u0627\u0628\u0639 success. \u0627\u06af\u0631 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0645\u0648\u0641\u0642\u06cc\u062a \u0622\u0645\u06cc\u0632 \u0628\u0627\u0634\u062f\u060c \u0628\u0627 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u067e\u0627\u0633\u062e \u0686\u0647 \u06a9\u0627\u0631\u06cc \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u062f \u0627\u0646\u062c\u0627\u0645 \u062f\u0647\u06cc\u062f.<\/p>\n<p>\u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0646\u0645\u0648\u0646\u0647\u060c \u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0628\u06cc\u0646\u06cc\u062f:<\/p>\n<pre class=\"lang:default decode:true\">$.post(\u2018post_response.php\u2019, info, function(responseData) { alert(responseData);}\r\n<\/pre>\n<p>\u062d\u0627\u0644\u0627 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u0639\u0646\u0648\u0627\u0646 \u0641\u06cc\u0644\u0645 \u0631\u0627 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 index.php \u0642\u0628\u0644\u06cc \u0648 \u0635\u0641\u062d\u0647 \u06cc process.php \u0648 connection.php \u067e\u06cc\u062f\u0627 \u06a9\u0646\u06cc\u0645\u061b \u0641\u0642\u0637 \u0641\u0627\u06cc\u0644 js\u060c \u06cc\u0639\u0646\u06cc ajaxMethod.js \u0631\u0627 \u0628\u0647 ajaxPost.js \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u06cc\u062f\u061b<\/p>\n<p>\u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0628\u0627\u06cc\u062f \u0645\u0627\u0646\u0646\u062f \u06a9\u062f \u0632\u06cc\u0631 \u0628\u0627\u0634\u062f:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t&lt;script type=\"text\/javascript\" src=\"js\/ajaxPost.js\"&gt;&lt;\/script&gt;\r\n\u06f2\tSave the following code as ajaxPost.js\r\n\u06f3\t$(document).ready(function(e) {\r\n\u06f4\t$('#title').on('keyup', function() {\r\n\u06f5\tvar filmName = $(this).val();\r\n\u06f6\t$.post('process.php',{title: filmName},function(data) {\r\n\u06f7\t$('#result').html(data);\r\n\u06f8\t}\r\n\u06f9\t);\/\/end of ajax method\r\n\u06f1\u06f0\t});\/\/end of on key up method\r\n\u06f1\u06f1\t});\/\/end of ready method\r\n<\/pre>\n<p>\u062a\u0648\u062c\u0647 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0627\u06cc\u0646 \u0645\u062a\u062f\u0650 $.post \u062f\u0631 \u0645\u0642\u0627\u06cc\u0633\u0647 \u0628\u0627 $.ajax\u060c \u0686\u0642\u062f\u0631 \u0633\u0627\u062f\u0647 \u062a\u0631 \u0648 \u0622\u0633\u0627\u0646 \u062a\u0631 \u0627\u0633\u062a. \u0627\u0645\u0627 \u062f\u0631 \u0627\u06cc\u0646 \u062c\u0627\u060c \u06a9\u0646\u062a\u0631\u0644 \u0647\u0627\u06cc\u06cc \u0646\u0638\u06cc\u0631 complete\u060c error\u060c dataType \u0648 \u063a\u06cc\u0631\u0647 \u0631\u0627 \u0627\u0632 \u062f\u0633\u062a \u062f\u0627\u062f\u0647 \u0627\u06cc\u0645.<\/p>\n<p>\u0627\u06a9\u0646\u0648\u0646 \u0627\u0632 $.post \u0648 $.ajax\u060c \u0628\u0633\u062a\u0647 \u0628\u0647 \u0646\u06cc\u0627\u0632\u0650 \u0628\u0631\u0646\u0627\u0645\u0647 \u06cc \u062e\u0648\u062f\u060c \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p><strong>\u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc <\/strong><strong>JSON<\/strong><strong> \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc \u06a9\u0646\u062f<\/strong><\/p>\n<h2>\u0645\u0642\u062f\u0645\u0647 \u0627\u06cc \u0628\u0631 JSON \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc<\/h2>\n<p>\u062f\u0648 \u0631\u0627\u0647 \u0628\u0631\u0627\u06cc \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc json \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u067e\u0627\u0633\u062e \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f\u060c \u0627\u0648\u0644\u06cc\u0646 \u0631\u0648\u0634\u060c \u062a\u0646\u0638\u06cc\u0645 dataType \u0628\u0631 \u0627\u0633\u0627\u0633 json \u062f\u0631 \u0645\u062a\u062f\u0650 $.ajax \u0648 \u067e\u0631\u062f\u0627\u0632\u0634 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc json \u062f\u0631 \u062a\u0627\u0628\u0639 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u0634\u062f\u0647 \u06cc success \u0627\u0633\u062a. \u0627\u0632 \u0633\u0648\u06cc \u062f\u06cc\u06af\u0631\u060c \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u0632 \u0633\u06cc\u0646\u062a\u06a9\u0633 \u06a9\u0648\u062a\u0627\u0647 $.getJSON \u0628\u0631\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062f\u0627\u062f\u0647 json \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<h3>\u0686\u0631\u0627 json \u0645\u0647\u0645 \u0627\u0633\u062a\u061f<\/h3>\n<p>\u062f\u0631 <strong>$.post()<\/strong> \u0648 <strong>$<\/strong><strong>ajax<\/strong><strong>()<\/strong> \u06a9\u0646\u062a\u0631\u0644\u06cc \u0628\u0631 \u0632\u0628\u0627\u0646 \u0637\u0631\u0641 \u0645\u0634\u062a\u0631\u06cc (\u0645\u062b\u0644 \u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a) \u0646\u062f\u0627\u0631\u06cc\u0645 \u06a9\u0647 \u0686\u06af\u0648\u0646\u0647 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0631\u0627 \u062f\u0631 \u0645\u06cc\u0627\u0646 \u0633\u0646\u062f \u0633\u0627\u0632\u0645\u0627\u0646\u062f\u0647\u06cc \u0648 \u062a\u0648\u0632\u06cc\u0639 \u06a9\u0646\u06cc\u0645. \u0641\u0642\u0637 \u062f\u0627\u062f\u0647 \u0647\u0627\u06cc \u067e\u0627\u0633\u062e \u0631\u0627 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 html \u06cc\u0627 \u0645\u062a\u0646 \u062f\u0631 div \u062f\u06cc\u06af\u0631\u06cc \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645. \u0627\u0645\u0627 \u0645\u0645\u06a9\u0646 \u0627\u0633\u062a \u0646\u06cc\u0627\u0632 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u0645 \u06a9\u0647 \u0639\u0646\u0648\u0627\u0646 \u0641\u06cc\u0644\u0645 \u0631\u0627 \u0628\u0647 \u06cc\u06a9 div \u0628\u062f\u0647\u06cc\u0645 \u0648 \u062a\u0648\u0636\u06cc\u062d\u0627\u062a \u0648 \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u062f\u06cc\u06af\u0631 \u0631\u0627 \u0628\u0647 div \u062f\u06cc\u06af\u0631\u06cc \u0648 \u06cc\u0627 \u0647\u0631 \u062c\u0627\u06cc\u06cc \u06a9\u0647 \u0645\u06cc \u062e\u0648\u0627\u0647\u06cc\u0645 \u0627\u0632 jquery \u06cc\u0627 javscript \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645. \u0633\u067e\u0633 \u0628\u0627\u06cc\u062f \u0627\u0632 $.getJSON \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0633\u06cc\u0646\u062a\u06a9\u0633 $.getJSON() \u0645\u0634\u0627\u0628\u0647 \u0633\u06cc\u0646\u062a\u06a9\u0633 $.post() \u0627\u0633\u062a \u06a9\u0647 \u0641\u0642\u0637 \u0646\u0627\u0645 \u0622\u0646 \u062a\u063a\u06cc\u06cc\u0631 \u06a9\u0631\u062f\u0647 \u0627\u0633\u062a. \u0648 \u0635\u0641\u062d\u0647 \u06cc Index.php \u0645\u0634\u0627\u0628\u0647 \u0635\u0641\u062d\u0647 \u06cc \u0645\u062a\u062f \u0627\u06cc\u062c\u06a9\u0633 \u0627\u0633\u062a.<\/p>\n<p>\u06a9\u062f \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0632\u06cc\u0631 \u0631\u0627 \u0628\u0627 \u0639\u0646\u0648\u0627\u0646 json.js \u062f\u0631 \u067e\u0648\u0634\u0647 \u06cc js \u062e\u0648\u062f \u0630\u062e\u06cc\u0631\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t$(document).ready(function(e) {\r\n\u06f2\t$('#title').on('keyup', function() {\r\n\u06f3\tvar filmName = $(this).val();\r\n\u06f4\t \r\n\u06f5\t$.getJSON(\"process.php\",{title:filmName},function(data){\r\n\u06f6\tvar title=\"&lt;ul&gt;\";\r\n\u06f7\tvar description=\"\";\r\n\u06f8\tfor(var i=0;i&lt;data.length;i++){\r\n\u06f9\ttitle+=\"&lt;li&gt;\"+ data[i].title+\"&lt;\/li&gt;\";\r\n\u06f1\u06f0\ttitle+=\"&lt;p&gt;\"+data[i].description+\"&lt;\/p&gt;\";\r\n\u06f1\u06f1\t}\r\n\u06f1\u06f2\ttitle+=\"&lt;\/ul&gt;\";\r\n\u06f1\u06f3\t$('#result').html(title);\r\n\u06f1\u06f4\t \r\n\u06f1\u06f5\t})\r\n\u06f1\u06f6\t});\/\/end of on key up method\r\n\u06f1\u06f7\t});\/\/end of ready method\r\n<\/pre>\n<p>\u0648 \u0635\u0641\u062d\u0647 \u06cc Process.php:<\/p>\n<pre class=\"lang:default decode:true\">\u06f1\t&lt;?php\r\n\u06f2\trequire '..\/connection.php';\r\n\u06f3\t$film_title = htmlspecialchars($_REQUEST['title'], ENT_QUOTES);\r\n\u06f4\t$query = $dbh-&gt;prepare(\"SELECT * FROM film_text WHERE title LIKE '$film_title%' LIMIT 10\");\r\n\u06f5\t$query-&gt;execute();\r\n\u06f6\t$data=$query-&gt;fetchAll(PDO::FETCH_ASSOC);\r\n\u06f7\techo json_encode($data);\r\n\u06f8\tJSON data Structure of this response\r\n\u06f9\tThis is sample response data to give an overview how to use this structure json data in success callback function to arrange or view them in web page.\r\n\u06f1\u06f0\t[\r\n\u06f1\u06f1\t{\r\n\u06f1\u06f2\t\"film_id\": \" film id\",\r\n\u06f1\u06f3\t\"title\": \"film title\",\r\n\u06f1\u06f4\t\"description\": \"descritpion\"\r\n\u06f1\u06f5\t},\r\n\u06f1\u06f6\t{\r\n\u06f1\u06f7\t\"film_id\": \" film id\",\r\n\u06f1\u06f8\t\"title\": \"another film title\",\r\n\u06f1\u06f9\t\"description\": \" another descritpion\"\r\n\u06f2\u06f0\t}\r\n\u06f2\u06f1\t]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0627\u06cc\u062c\u06a9\u0633 \u06cc\u0627 Ajax (\u062c\u0627\u0648\u0627 \u0627\u0633\u06a9\u0631\u06cc\u067e\u062a \u0648 XML \u0622\u0633\u0646\u06a9\u0631\u0648\u0646 \/ Asynchronous JavaScript and XML) \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u06cc\u06a9 \u0631\u0648\u0634 \u0633\u0627\u062e\u062a \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062a\u0639\u0627\u0645\u0644\u06cc \u0648\u0628 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0644\u0627\u0641\u0627\u0635\u0644\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u067e\u0631\u062f\u0627\u0632\u0634 \u0645\u06cc \u06a9\u0646\u0646\u062f.(\u062a\u0648\u0635\u06cc\u0647 \u0645\u06cc \u0634\u0648\u062f\u00a0\u062f\u0648\u0631\u0647 \u0622\u0645\u0648\u0632\u0634\u06cc \u0637\u0631\u0627\u062d\u06cc \u0633\u0627\u06cc\u062a \u0648 \u067e\u06a9\u06cc\u062c \u0622\u0645\u0648\u0632\u0634 \u0637\u0631\u0627\u062d\u06cc \u0633\u0627\u06cc\u062a\u00a0 \u0631\u0627 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f) \u0647\u0646\u06af\u0627\u0645\u06cc \u06a9\u0647 \u06cc\u06a9 \u06a9\u0627\u0631\u0628\u0631 \u06cc\u06a9 \u0639\u0645\u0644 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc \u062f\u0647\u062f\u060c &hellip;<\/p>\n","protected":false},"author":8,"featured_media":2723,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[7,176,177,178,125],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0627\u06cc\u062c\u06a9\u0633 (Ajax) \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc - \u0628\u0644\u0627\u06af \u0622\u0645\u0648\u0632\u0634 \u062a\u06a9<\/title>\n<meta name=\"description\" content=\"\u0627\u06cc\u062c\u06a9\u0633 \u06cc\u0627 Ajax \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u06cc\u06a9 \u0631\u0648\u0634 \u0633\u0627\u062e\u062a \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062a\u0639\u0627\u0645\u0644\u06cc \u0648\u0628 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0644\u0627\u0641\u0627\u0635\u0644\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u067e\u0631\u062f\u0627\u0632\u0634 \u0645\u06cc \u06a9\u0646\u0646\u062f. \u0627\u06cc\u062c\u06a9\u0633 \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0641\u0642\u0637 \u06cc\u06a9 \u0642\u0633\u0645\u062a \u0627\u0632 \u0635\u0641\u062d\u0647 \u0648\u0628 \u0631\u0627 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0628\u0642\u06cc\u0647 \u0622\u0646\u060c \u062a\u062d\u062a \u062a\u0627\u062b\u06cc\u0631 \u0642\u0631\u0627\u0631 \u0646\u0645\u06cc \u06af\u06cc\u0631\u062f. \u0646\u0642\u0634\u0647 \u06cc Google map \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 \u06cc \u0645\u0634\u0647\u0648\u0631 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0627\u06cc\u062c\u06a9\u0633 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u062f.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0627\u06cc\u062c\u06a9\u0633 (Ajax) \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc - \u0628\u0644\u0627\u06af \u0622\u0645\u0648\u0632\u0634 \u062a\u06a9\" \/>\n<meta property=\"og:description\" content=\"\u0627\u06cc\u062c\u06a9\u0633 \u06cc\u0627 Ajax \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u06cc\u06a9 \u0631\u0648\u0634 \u0633\u0627\u062e\u062a \u0628\u0631\u0646\u0627\u0645\u0647 \u0647\u0627\u06cc \u062a\u0639\u0627\u0645\u0644\u06cc \u0648\u0628 \u0627\u0633\u062a \u06a9\u0647 \u0628\u0644\u0627\u0641\u0627\u0635\u0644\u0647 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0647\u0627\u06cc \u06a9\u0627\u0631\u0628\u0631 \u0631\u0627 \u067e\u0631\u062f\u0627\u0632\u0634 \u0645\u06cc \u06a9\u0646\u0646\u062f. \u0627\u06cc\u062c\u06a9\u0633 \u062f\u0631 \u062c\u06cc \u06a9\u0648\u0626\u0631\u06cc \u0641\u0642\u0637 \u06cc\u06a9 \u0642\u0633\u0645\u062a \u0627\u0632 \u0635\u0641\u062d\u0647 \u0648\u0628 \u0631\u0627 \u0628\u0627\u0631\u06af\u0630\u0627\u0631\u06cc \u0645\u06cc \u06a9\u0646\u062f \u0648 \u0628\u0642\u06cc\u0647 \u0622\u0646\u060c \u062a\u062d\u062a \u062a\u0627\u062b\u06cc\u0631 \u0642\u0631\u0627\u0631 \u0646\u0645\u06cc \u06af\u06cc\u0631\u062f. \u0646\u0642\u0634\u0647 \u06cc Google map \u06cc\u06a9 \u0628\u0631\u0646\u0627\u0645\u0647 \u06cc \u0645\u0634\u0647\u0648\u0631 \u0627\u0633\u062a \u06a9\u0647 \u0627\u0632 \u0627\u06cc\u062c\u06a9\u0633 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u062f.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af \u0622\u0645\u0648\u0632\u0634 \u062a\u06a9\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/amuzeshtakcom\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-05-17T06:30:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-04T03:32:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/ajax-with-jquery.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"\u0622\u0645\u0648\u0632\u0634 \u062a\u06a9\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"3 \u062f\u0642\u06cc\u0642\u0647\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#organization\",\"name\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u062a\\u06a9\",\"url\":\"https:\/\/amuzeshtak.com\/blog\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/amuzeshtakcom\/\",\"https:\/\/www.instagram.com\/amuzeshtak\/\",\"https:\/\/www.linkedin.com\/in\/amuzesh-tak-853831147\/detail\/recent-activity\/\",\"https:\/\/www.youtube.com\/channel\/UCYhOxPGb9fR2jBjTuU6EHdQ?view_as=subscriber\",\"https:\/\/www.pinterest.com\/amuzeshtak\/\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#logo\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2018\/05\/logo.png\",\"width\":150,\"height\":150,\"caption\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u062a\\u06a9\"},\"image\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#website\",\"url\":\"https:\/\/amuzeshtak.com\/blog\/\",\"name\":\"\\u0628\\u0644\\u0627\\u06af \\u0622\\u0645\\u0648\\u0632\\u0634 \\u062a\\u06a9\",\"description\":\"\\u0645\\u0631\\u062c\\u0639 \\u0645\\u0642\\u0627\\u0644\\u0627\\u062a \\u0622\\u0645\\u0648\\u0632\\u0634\\u06cc\",\"publisher\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/amuzeshtak.com\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#primaryimage\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/amuzeshtak.com\/blog\/wp-content\/uploads\/2019\/05\/ajax-with-jquery.jpg\",\"width\":750,\"height\":422,\"caption\":\"\\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#webpage\",\"url\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/\",\"name\":\"\\u0627\\u06cc\\u062c\\u06a9\\u0633 (Ajax) \\u062f\\u0631 \\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc - \\u0628\\u0644\\u0627\\u06af \\u0622\\u0645\\u0648\\u0632\\u0634 \\u062a\\u06a9\",\"isPartOf\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#primaryimage\"},\"datePublished\":\"2019-05-17T06:30:30+00:00\",\"dateModified\":\"2020-04-04T03:32:13+00:00\",\"description\":\"\\u0627\\u06cc\\u062c\\u06a9\\u0633 \\u06cc\\u0627 Ajax \\u062f\\u0631 \\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc \\u06cc\\u06a9 \\u0631\\u0648\\u0634 \\u0633\\u0627\\u062e\\u062a \\u0628\\u0631\\u0646\\u0627\\u0645\\u0647 \\u0647\\u0627\\u06cc \\u062a\\u0639\\u0627\\u0645\\u0644\\u06cc \\u0648\\u0628 \\u0627\\u0633\\u062a \\u06a9\\u0647 \\u0628\\u0644\\u0627\\u0641\\u0627\\u0635\\u0644\\u0647 \\u062f\\u0631\\u062e\\u0648\\u0627\\u0633\\u062a \\u0647\\u0627\\u06cc \\u06a9\\u0627\\u0631\\u0628\\u0631 \\u0631\\u0627 \\u067e\\u0631\\u062f\\u0627\\u0632\\u0634 \\u0645\\u06cc \\u06a9\\u0646\\u0646\\u062f. \\u0627\\u06cc\\u062c\\u06a9\\u0633 \\u062f\\u0631 \\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc \\u0641\\u0642\\u0637 \\u06cc\\u06a9 \\u0642\\u0633\\u0645\\u062a \\u0627\\u0632 \\u0635\\u0641\\u062d\\u0647 \\u0648\\u0628 \\u0631\\u0627 \\u0628\\u0627\\u0631\\u06af\\u0630\\u0627\\u0631\\u06cc \\u0645\\u06cc \\u06a9\\u0646\\u062f \\u0648 \\u0628\\u0642\\u06cc\\u0647 \\u0622\\u0646\\u060c \\u062a\\u062d\\u062a \\u062a\\u0627\\u062b\\u06cc\\u0631 \\u0642\\u0631\\u0627\\u0631 \\u0646\\u0645\\u06cc \\u06af\\u06cc\\u0631\\u062f. \\u0646\\u0642\\u0634\\u0647 \\u06cc Google map \\u06cc\\u06a9 \\u0628\\u0631\\u0646\\u0627\\u0645\\u0647 \\u06cc \\u0645\\u0634\\u0647\\u0648\\u0631 \\u0627\\u0633\\u062a \\u06a9\\u0647 \\u0627\\u0632 \\u0627\\u06cc\\u062c\\u06a9\\u0633 \\u0627\\u0633\\u062a\\u0641\\u0627\\u062f\\u0647 \\u0645\\u06cc \\u06a9\\u0646\\u062f.\",\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/\"]}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#webpage\"},\"author\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#\/schema\/person\/02405671561ee775f2d6a81ccf8af9d3\"},\"headline\":\"\\u0627\\u06cc\\u062c\\u06a9\\u0633 (Ajax) \\u062f\\u0631 \\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc\",\"datePublished\":\"2019-05-17T06:30:30+00:00\",\"dateModified\":\"2020-04-04T03:32:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#webpage\"},\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#primaryimage\"},\"keywords\":\"javascript,jquery,\\u0622\\u0645\\u0648\\u0632\\u0634 \\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc,\\u062c\\u06cc \\u06a9\\u0648\\u0626\\u0631\\u06cc,\\u0637\\u0631\\u0627\\u062d\\u06cc \\u0633\\u0627\\u06cc\\u062a\",\"articleSection\":\"\\u0648\\u0628\",\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/amuzeshtak.com\/blog\/ajax-with-jquery\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#\/schema\/person\/02405671561ee775f2d6a81ccf8af9d3\",\"name\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u062a\\u06a9\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/amuzeshtak.com\/blog\/#personlogo\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/137db7c478d9789aa9bd635c4bcefc49?s=96&d=mm&r=g\",\"caption\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u062a\\u06a9\"},\"sameAs\":[\"http:\/\/amuzeshtak.com\/\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/posts\/2697"}],"collection":[{"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/comments?post=2697"}],"version-history":[{"count":4,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/posts\/2697\/revisions"}],"predecessor-version":[{"id":4066,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/posts\/2697\/revisions\/4066"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/media\/2723"}],"wp:attachment":[{"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/media?parent=2697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/categories?post=2697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amuzeshtak.com\/blog\/wp-json\/wp\/v2\/tags?post=2697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}