[英]Liferay under IE8, YUI Error: Invalid Argument
我在帶有Win XP的IE8上測試了Liferay 6.2 Portal,並收到以下錯誤消息:
網頁錯誤詳細信息
消息:無效的參數。 線:18772字符:13代碼:0 URI: http ://a3f36f75.ngrok.io/html/js/everything.jsp?browserId=ie&themeId=eacat_WAR_eacattheme&colorSchemeId=01&minifierType=js&minifierBundleId=javascript.everything.files&0&uuu142142
顯然是在YUI模塊上與此功能有關的錯誤:
/**
* Sets a style property for a given element.
* @method setStyle
* @param {HTMLElement} An HTMLElement to apply the style to.
* @param {String} att The style property to set.
* @param {String|Number} val The value.
*/
setStyle: function(node, att, val, style) {
style = style || node.style;
var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES;
if (style) {
if (val === null || val === '') { // normalize unsetting
val = '';
} else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit
val += Y_DOM.DEFAULT_UNIT;
}
if (att in CUSTOM_STYLES) {
if (CUSTOM_STYLES[att].set) {
CUSTOM_STYLES[att].set(node, val, style);
return; // NOTE: return
} else if (typeof CUSTOM_STYLES[att] === 'string') {
att = CUSTOM_STYLES[att];
}
} else if (att === '') { // unset inline styles
att = 'cssText';
val = '';
}
style[att] = val;
}
},
有人知道這里發生了什么嗎? 我使用datatable和Alloy UI來實現該表,還注意到該表的dom操作不適用於IE8,這是代碼:
var nodeObject = Y.one('#myDataTable table');
nodeObject.removeClass('table-table');
nodeObject.addClass('table');
nodeObject.addClass('mytable');
nodeObject.addClass('table-hover');
以下選擇器無效:
:nth-last-of-ype(n+2)
它應該是:
:nth-last-of-type(n+2)
setStyle
方法將DOM節點作為其第一個參數:
因此,此語法:
ocultar.setStyle('display','none');
參數無效,因為display
不是DOM節點。
參考文獻
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.