$ .Ajax没有"_"查询字符串参数

Dea*_*bit 5 ajax jquery dynamics-crm-2011

我正在使用$ .ajax方法动态地包含插件脚本文件,遗憾的是,由于整个项目都托管在Dynamics CRM 2011中,因此没有查询字符串参数可以传递给此请求而不会以错误的方式摩擦CRM.

执行以下操作:

$.ajax({
    url: includeUrl, // == "Templates.js"
    dataType: "script",
    success: function (includedFile) {
        window.Includes.push(includedFile);
    }
});
Run Code Online (Sandbox Code Playgroud)

将返回500 - Internal Server Error查看我已请求以下URL的firebug控制台:

http://server:5555/Organisation/WebResources/grid_/Templates.js?_=1366828753001
Run Code Online (Sandbox Code Playgroud)

已经_=1366828753001通过$ .Ajax方法附加了这个参数.. CRM不太喜欢这个...我问这知道我可能介于摇滚和硬地之间但有没有办法调用$ .ajax强制它不会将此ID附加到查询字符串中?

CRM完全错误:

<description>CRM Parameter Filter - Invalid parameter '_=1366828753001' in Request.QueryString on page /Organisation/Handlers/WebResource.ashx
The raw request was 'GET /Organisation/WebResources/grid_/Templates.js?_=1366828753001' called from http://server:5555/Organisation/WebResources/grid_/EditableGrid.htm.</description>
Run Code Online (Sandbox Code Playgroud)

Bar*_*man 10

设置cache: true为$ .ajax()调用的参数

jQuery附加的查询字符串,以防止缓存所请求的资源.

  • 你实际上想要将其设置为true以防止添加查询字符串 (4认同)