如何模拟被阻止的ajax?

我们正在为某些政府部门做事。他们使用我们的Web应用程序,主要获取有关他们的特定项目的详细信息。 他们在员工的浏览器中允许使用javascript,但似乎在防火墙(或通过其他方式)阻止了ajax。 是否可以通过某种方式在IE或Firefox中对此进行模拟,以便我们可以测试和修改代码以提供相同功能的其他方式? 即——我们要向所有人显示一个非ajax版本,然后将使用ajax的用户重定向到ajax版本,所以我们需要模拟非ajax情况以测试分支代码。

Blocking ajax can be done at server side. Depends on the technology you are using but let the ajax call a page on your website and just put a thread.sleep or similar...

To really simulate this, you'll have to get the configurations of the server, and know exactly what types of calls are being blocked.

In a lower level, ajax calls are made much like normal requests. So you may be able to get around this by settings custom headers to simulate allowed requests.

They probably won't give you this information, but if they do, it will be easy to check in your server-side the presence of the header, and return same status if it's not.

Without details of the server config, I can't help you more than this.