{"flag":true,"single":true,"pageTitle":"Ajax Jquery: Load data from file and return to the element","post":{"id":224,"user_id":"1","slug":"ajax-jquery-load-data-from-file-and-return-to-the-element-vyzs","title":"Ajax Jquery: Load data from file and return to the element","body":"<pre class=\"language-markup\"><code>&lt;script&gt;\r\n$(document).ready(function(){\r\n  $(\"button\").click(function(){\r\n\t  $(\"#div1\").load(\"demo_test.txt\", function(responseTxt, statusTxt, xhr){\r\n\t    if(statusTxt == \"success\")\r\n\t      alert(\"External content loaded successfully!\");\r\n\t    if(statusTxt == \"error\")\r\n\t      alert(\"Error: \" + xhr.status + \": \" + xhr.statusText);\r\n\t  });\r\n\t});\r\n});\r\n&lt;\/script&gt;<\/code><\/pre>","category_id":"28","is_private":"0","created_at":"2023-11-10T02:38:44.000000Z","updated_at":"2023-11-10T02:38:44.000000Z","category":{"id":28,"user_id":"1","name":"Jquery","slug":"jquery-k1v4","parent_id":"12","created_at":"2023-11-10T01:48:35.000000Z","updated_at":"2023-11-10T01:48:35.000000Z"},"user":{"id":1,"name":"R GONDAL","email":"rizikmw@gmail.com","email_verified_at":null,"two_factor_confirmed_at":null,"current_team_id":"1","profile_photo_path":null,"created_at":"2023-03-12T10:49:33.000000Z","updated_at":"2025-01-10T12:59:00.000000Z","profile_photo_url":"https:\/\/ui-avatars.com\/api\/?name=R+G&color=7F9CF5&background=EBF4FF"}},"pageDesc":"&lt;script&gt; $(document).ready(function(){   $(\"button\").click(function(){ \t  $(\"#div1\").load(\"demo_test.txt\", function(responseTxt, statu - Ajax Jquery: Load data from file and return to the element (Updated: November 10, 2023) - Read more about Ajax Jquery: Load data from file and return to the element at my programming site [SITE]","categories":[]}