Encountering 403 error while using ajax call on IE

2020-03-24 05:52发布

问题:

I've my website loading pages using ajax. The pages are loaded properly in all the browsers except IE which throws an error 403 on the ajax request. However, it works fine in localhost even in IE. (Earlier it use to work properly, not sure when it began to act like that).

You can please check my site at http://ptamzz.com. Clicking on any article will make an ajax call for the content.

How do I fix it? Since it receives a HTTP 403 response, no data are returned so I'm unable to display my pages.

回答1:

Put this into your HTML header:

<meta http-equiv="X-UA-Compatible" content="IE=9"></meta>

Without the line, IE < 9 compatibility mode will be running on Linux Apache server and many functions will not work correctly in IE (even if they work with application on Windows localhost, or in different browser.