如何修复Windows 8 / IE11中的Internet Explorer已停止工作错误?

时间:2014-02-04 16:48:10

标签: javascript jquery internet-explorer-11

提交表单时出现IE11错误,问题是在提交表单IE浏览器停止工作时,要求是,有一个表单和所有输入文本值获取加载页面本身的“默认文本”,所以以前我们使用了一个jquery插件。   但它在IE11中不受支持。所以我删除了jquery默认文本插件并手动添加代码,这里是代码。

/*default text related code starts here*/
$(document).ready(function() {
    $('input[type="text"]').each(function(){
        if($(this).attr('title') && this.value == ''){
            this.value = $(this).attr('title');
            $(this).addClass('text-label');
        }        
        $(this).focus(function(){
            if(this.value == $(this).attr('title')) {
                this.value = '';
                $(this).removeClass('text-label');
            }
        });

        $(this).blur(function(){
            if($(this).attr('title') && this.value == '') {           
                this.value = $(this).attr('title');           
            }
        });
    });

    $('select').each(function(){
        if($("select option:selected").val() == '' || $("select option:selected").val() == null){
            $(this).addClass('text-label');
            $(this).change(function(){
                $(this).removeClass('text-label');
            });
        }else{
            $(this).css("color","#000");
        }
        $('option').css("color","#000");  
    });
    /*default text related code ends here*/

此代码在IE11中正常工作,但在windows8 / IE11中无效。   请帮助解决方案。

以下是截屏IE 11 crashing

0 个答案:

没有答案
相关问题