开发者

simulate ajax being blocked

We're doing some stuff for some government departments. The web application of ours which they're using uses Ajax in places (mainly to fetch details about specific items they've clicked on).

They allow javascript in their staff's browser but seem to block ajax at their firewall (or by some other means).

Is there some way to simulate this in IE or Firefox so we can test and modify our code to provide alternative ways of providing the same functionality?

Even if开发者_高级运维 we were to show everyone a non-ajax version and then redirect people with ajax to the ajax version we'd still need to simulate the non-ajax situation to test the branching code.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜