{"id":1104,"date":"2022-08-30T15:12:27","date_gmt":"2022-08-30T15:12:27","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/ie8s-ajax-cant-get-the-data-from-php-file-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:12:27","modified_gmt":"2022-08-30T15:12:27","slug":"ie8s-ajax-cant-get-the-data-from-php-file-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/ie8s-ajax-cant-get-the-data-from-php-file-collection-of-common-programming-errors\/","title":{"rendered":"IE8&#39;s AJAX can&#39;t get the data from php file-Collection of common programming errors"},"content":{"rendered":"<p>I use AWS with Apache, PHP, MySql.<\/p>\n<p>and I tried Ajax.<\/p>\n<pre><code>ajax.php\n\n$.ajax({\n    url: \"back.php\", \n    cache:false,\n    success: function(data) {\n        alert(data);\n    }\n});\n<\/code><\/pre>\n<p>and<\/p>\n<pre><code>back.php\n\n<\/code><\/pre>\n<p>and<\/p>\n<pre><code>back.html\n\n    hi 100\n<\/code><\/pre>\n<p>ajax.php, back.php, back.html are in same folder.<\/p>\n<p>Safari, Chrome, FF is working well. but only IE8 can&#8217;t get the data from back.php IE can get the success but IE alert(undefined). (data = undefined)<\/p>\n<p>if I change url: &#8220;back.html&#8221; then it is ok.<\/p>\n<p>and I move this source to other server, IE8 also Ok.<\/p>\n<p>Who can fix it? shall i change server&#8217;s php env value?<\/p>\n<p>Thanks.<\/p>\n<p>&#8230;. ah, I tried to use this header, and not working.<\/p>\n<pre><code>header(\"Expires: Sun, 19 Nov 1978 05:00:00 GMT\");\nheader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\nheader(\"Cache-Control: no-store, no-cache, must-revalidate\");\nheader(\"Cache-Control: post-check=0, pre-check=0\", true);\nheader(\"Pragma: no-cache\");\nheader('Content-type: text\/plain; Charset=utf-8');\n<\/code><\/pre>\n<p>and i tried to<\/p>\n<pre><code>url: \"back.php?foo=\",\n<\/code><\/pre>\n<p>also not working.<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:24:50. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I use AWS with Apache, PHP, MySql. and I tried Ajax. ajax.php $.ajax({ url: &#8220;back.php&#8221;, cache:false, success: function(data) { alert(data); } }); and back.php and back.html hi 100 ajax.php, back.php, back.html are in same folder. Safari, Chrome, FF is working well. but only IE8 can&#8217;t get the data from back.php IE can get the success [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1104","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1104"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1104\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}