最近做Web前端开发,遇到了一些 Js的效果在E8上面无法正常使用,如:
1。themeswitchertool.js 但是themeswitchertool-original.js则可以正常使用,他们的区别就是前者图片来源本地,后者则是网上图片
2。IE7 或者 IE8 兼容模式下切换皮肤 超过3此后则切换不成功
3。这些在ff下面都可正常使用
弄的很是郁闷,初学者,对浏览器不是很了解 希望得到指点及帮助

解决方案 »

  1.   

    jQuery.cookie = function(name, value, options) {
        if (typeof value != 'undefined') { // name and value given, set cookie
            options = options || {};
            if (value === null) {
                value = '';
                options.expires = -1;
            }
            var expires = '';
            if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
                var date;
                if (typeof options.expires == 'number') {
                    date = new Date();
                    date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
                } else {
                    date = options.expires;
                }
                expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
            }
            // CAUTION: Needed to parenthesize options.path and options.domain
            // in the following expressions, otherwise they evaluate to undefined
            // in the packed version for some reason...
            var path = options.path ? '; path=' + (options.path) : '';
            var domain = options.domain ? '; domain=' + (options.domain) : '';
            var secure = options.secure ? '; secure' : '';
            document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
        } else { // only name given, get cookie
            var cookieValue = null;
            if (document.cookie && document.cookie != '') {
                var cookies = document.cookie.split(';');
                for (var i = 0; i < cookies.length; i++) {
                    var cookie = jQuery.trim(cookies[i]);
                    // Does this cookie string begin with the name we want?
                    if (cookie.substring(0, name.length + 1) == (name + '=')) {
                        cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                        break;
                    }
                }
            }
            return cookieValue;
        }
    };
      

  2.   

    /* Theme Loading
    ---------------------------------------------------------------------*/
    switcherpane.find('a').click(function(){
    updateCSS( $(this).attr('href') );
    var themeName = $(this).find('span').text();
    button.find('.jquery-ui-themeswitcher-title').text( options.buttonPreText + themeName );
    $.cookie(options.cookieName, themeName, options);
    options.onSelect();
    if(options.closeOnSelect && switcherpane.is(':visible')){ switcherpane.spHide(); }
    return false;
    });
      

  3.   

    不是图片不显示 总是请求不成功…… 主题切换时请求了Jquery。all。css  但是总是无法正常显示
      

  4.   

    这个还得自己跟一下代码
    把ie的“禁止调试脚本”的勾去掉,在js里加debugger跟一下
      

  5.   

    2。IE7 或者 IE8 兼容模式下切换皮肤 超过 3次 后则切换不成功但是点击刷新后则显示成功……