Skip to content

Commit 06a4cf7

Browse files
committed
baidu/page/load.js修改
[bugfix]修复了xxx.js?abc取不到扩展名的问题 baidu/page/load.js在获取扩展名上使用了正则
1 parent 91b3476 commit 06a4cf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/baidu/page/load.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ baidu.page.load = /**@function*/function(resources, options, ignoreAllLoaded) {
174174
}
175175
};
176176
//默认用后缀名, 并防止后缀名大写
177-
res.type = res.type || url.substr(url.lastIndexOf('.') + 1);
177+
res.type = res.type || url.replace(/^[^\?#]+\.(css|js|html)(\?|#| |$)[^\?#]*/i, '$1');
178178
//默认html格式用ajax请求,其他都使用dom标签方式请求.
179179
res.requestType = res.requestType || (res.type == 'html' ? 'ajax' : 'dom');
180180

0 commit comments

Comments
 (0)