草庐IT

internet-explorer-global-variable

全部标签

javascript - Internet Explorer 中的只读输入框错误

我有一个奇怪的错误,好吧,MSIE有。似乎它在所有主要的MSIE版本上都失败了:6、7、8和9(!)testjQuery(document).ready(function(){vartest=jQuery('#in');test.focus(function(){if(test.val()=='empty')test.val('');test.attr('readonly',false);});test.blur(function(){if(test.val()=='')test.val('empty');test.attr('readonly',true);});});让我解释一下这

javascript - 引用错误 : Can't find variable: require at

我有一个关于将jasmine与Grunt一起使用的问题。我一直收到错误,ReferenceError:找不到变量:requireat每当我运行jasmine测试时。这是我的Gruntfile.js的jasmine条目:jasmine:{js:{src:jsFiles,options:{specs:'tests/*_spec.js',helpers:'tests/helpers/*',vendor:'vendor/*'}}},我可以在没有require的情况下运行虚拟测试,但当我在测试中包含require时,就像这样,我会收到require错误。vartestD=require('../

javascript - 混合模式 :multiply in Internet Explorer

我需要在乘法模式下将图像与红色方block混合在一起。据我所知,IE和Safari不支持css属性“混合模式”,因此我尝试将它们混合在Canvas中,一切正常-除了IE。有没有什么方法可以在IE中将它们混合在一起,或者目前还不支持这种方法? 最佳答案 对于InternetExplorer,Canvas混合模式“正在考虑中”。https://developer.microsoft.com/en-us/microsoft-edge/platform/status/mixblendmode/?q=blend在IE中实现混合之前,您可以滚动

javascript - jQuery 在我的 Internet Explorer 中的 Facebook 应用程序中不起作用 - 访问被拒绝

Justspentabout5hourssortingoutthisissue,soIthoughtsharinghowIovercameitwouldbehelpfultosomeoneandsavethemsometime(itseemstobeaprettyrecentfix-9hoursagoatthetimeofpostingthisquestion-whichIfoundhere).IamusingjQueryversion1.10.1.概览我正在构建一个Facebook选项卡应用程序。这是一个竞赛报名表,访问者将在其中输入一些信息并上传他们在最近假期拍摄的照片。在嵌入到F

javascript - 如何通过 Internet Explorer 访问网络摄像头(11)?

关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭8年前。Improvethisquestion上下文:我正在构建一个离线网站(html5、css、js),我想通过IE(11)调用它。为了拍摄/保存照片,我需要访问网络摄像头。方法:我读到IE不支持getUserMedia;唯一的方法是使用闪光灯。问题:是否只有使用flash才能通过IE访问网络摄像头?如果是,请推荐一个例子。非常感谢您的意见。

javascript - Internet Explorer 11 上的 SweetAlert2 语法错误

我正在使用SweetAlert2examplespage的确切代码:swal({title:'Areyousure?',text:"Youwon'tbeabletorevertthis!",type:'warning',showCancelButton:true,confirmButtonColor:'#3085d6',cancelButtonColor:'#d33',confirmButtonText:'Yes,deleteit!'}).then((result)=>{if(result.value){swal('Deleted!','Yourfilehasbeendeleted.'

javascript - document.getElementById(...).setAttribute ('style' ,... 在 Internet Explorer 中不起作用

这个问题在这里已经有了答案:setAttributeisnotworkingfor'style'attributeonIE(6个答案)关闭8年前。document.getElementById(...).setAttribute('style',...在InternetExplorer7.0中不工作。我怎样才能在InternetExplorer中工作?varmyarray=newArray(3);for(i=0;iold

javascript - 为什么 indexOf 在 Internet Explorer 中不起作用?

此函数在表单onSubmit期间执行,并且在Firefox和Chrome中工作正常,但在IE中不工作。我怀疑它是indexOf,但我似乎找不到让它工作的方法。functioncheckSuburbMatch(e){vartheSuburb=document.getElementById('suburb').value;varthePostcode=document.getElementById('postcode').value;vararrayNeedle=theSuburb+"("+thePostcode+")";if(suburbs.indexOf(arrayNeedle)!=-

javascript - 使用 javascript 在 Internet Explorer 中迭代 formData 对象

正在使用表单ID创建一个formData对象并执行以下操作:varformDataDetails=newFormData(document.getElementById("form_id"));for(varentryofformDataDetails{res[entry[0]]=entry[1];}我稍后会做JSONstringify和做POST。但是我最近发现'InternetExplorer'还不支持for..of循环。而且我认为使用for..in循环是不正确的,因为它用于遍历可枚举对象(而是循环遍历对象的属性)。对于InternetExplorer,我应该如何遍历formDat

javascript - 如何检查 ES6 "variable"是否不变?

有谁知道一些技巧如何做到这一点?我尝试使用try-catch:"usestrict";consta=20;varisConst=false;try{vartemp=a;a=a+1;a=temp;}catch(e){isConst=true;}但不幸的是,它只能在“严格”模式下工作。如果不使用“usestrict”,它会静默执行所有语句,而不会修改a。此外,我无法将此代码包装到一些方便的函数中(例如isConstant(someConst)),因为我将传递给该函数的任何参数都将是一个新变量。所以有人知道如何创建isConstant()函数吗? 最佳答案