1.trim函数在浏览器兼容性问题
function String.prototype.trim()
{return this.replace(/(^\s*)|(\s*$)/g,"");
}
更改为:
if(typeof String.prototype.trim=='undefined'){String.prototype.trim = function () {
return this .replace(/^\s\s*/, '' ).replace(/\s\s*$/, '' );
}
}
function document.onkeydown(){
if(event.keyCode==116){
event.keyCode = 0;
event.cancelBubble = true;
return false;
}
}
更改为
function onkeydown(e) {
var currKey=0,e=e||event;
currKey=e.keyCode||e.which||e.charCode;//支持IE、FF
if (currKey == 116) {
event.keyCode = 0;
event.cancelBubble = true;
return false;
}
}
3.
function document.onclick()
{
if(WebCalendar.eventSrc != window.event.srcElement)
hiddenCalendar();
}
更改为:
document.οnclick=function()
{
if(WebCalendar.eventSrc != window.event.srcElement)
hiddenCalendar();
};
4.document.frames在不同浏览器的兼容性问题
document.frames["eosCalendarIframe"];
更改为:
window.frames["eosCalendarIframe"];