草庐IT

ELEMENT_NAME

全部标签

javascript - Firefox 控制台在 HTTP 204 响应中抛出 "no element found"

一切正常,但我无法在firefox控制台中消除此错误:noelementfound我正在向我的api发送HTTP请求:$http({url:API_LOCATION+'expenses/'+obj.expense.id+'/',method:"DELETE",}).then(function(response){if(response.status===204){varparams=$location.search();params['alert-success']=ALERTS.EXPENSE_DELETED;$location.search(params);}$route.relo

javascript - 未捕获的类型错误 : Cannot read property 'name' of undefined

我尝试使用facebookapi将数据提取到表单输入中。现在,一切都很顺利,直到我还尝试获取当前用户的位置。如果当前用户分享了他的位置(他住在哪里),那么我就没有问题。但是,如果用户没有在Facebook上分享他的位置,我会收到一个错误:未捕获的类型错误:无法读取未定义的属性“名称”这是我一直在使用的代码。如果您有解决方法,请在此处发表评论:)//AdditionalJSfunctionsherewindow.fbAsyncInit=function(){FB.init({appId:'*******',//AppIDstatus:true,//checkloginstatuscook

javascript - 华丽的弹出窗口 : Get current element in callback

在MagnificPopup中,我想在点击的链接中获取一个属性,并在回调函数中使用它(使用回调:open)来对DOM进行一些更改。我该怎么做?例如,在下面的代码中,它应该向控制台返回“itworks”。相反,它会打印“不起作用”。请帮忙!!Showinlinepopup$(document).ready(function(){$('.open-popup-link').magnificPopup({type:'inline',midClick:true,callbacks:{open:function(){if($(this).attr('myatt')=="hello"){//dos

javascript - Google Places JavaScript 自动完成 : can I remove the country from the place name?

我有以下jQuery代码,可以很好地获取所选国家/地区的城市列表。varcity;varplace;$('#city').on('focus',function(){input=this,options={types:['(cities)'],componentRestrictions:{country:$('#countryoption:selected').val()}};city=newgoogle.maps.places.Autocomplete(input,options);google.maps.event.addListener(city,'place_changed',

javascript - Webkit 错误 : Overflow auto triggered after resizing a child element to matching size

我有以下简单设置:document.getElementById('inner').addEventListener('click',({target})=>{target.classList.add('match');});#container{background:green;overflow:auto;width:200px;height:100px;}#inner{width:210px;height:110px;}#inner.match{width:200px;height:100px;}单击内部元素后,我希望父元素上的滚动条消失,因为这两个元素现在具有匹配的大小。这在Fi

javascript - ng :test no injector found for element argument to getTestability

关于SO的其他问题也有同样的问题,但解决方案对我没有用。这是我的spec.jsdescribe('ProtractorDemoApp',function(){it('shouldhaveatitle',function(){browser.driver.get('http://rent-front-static.s3-website-us-east-1.amazonaws.com/');expect(browser.getTitle()).toEqual('HowItWorks');});});这是我的conf.jsexports.config={framework:'jasmine'

javascript - 为什么 MS Edge 不使用 spread element 和 querySelector?

在发布的另一个问题中:vara={};a.products=[...document.querySelectorAll('.product')];console.log(a.products);Edge将失败并出现以下错误:functionexpected但是这是可行的:varparams=['hello','',7];varother=[1,2,...params];console.log(params);console.log(other);为什么最上面的那个不能在Edge上运行(它在Chrome上运行)? 最佳答案 你可以使用

javascript - Protractor - 失败 : stale element reference: element is not attached to the page document

我的Protractore2e页面对象中有一个函数可以取消选中下拉菜单中的多个选项。它以前工作正常,但现在我收到以下错误:Failed:staleelementreference:elementisnotattachedtothepagedocument我已经尝试在for循环的每次迭代中获取元素,但是for循环在第一次解决promise之前执行,这意味着x的“限制”值被重复传递,并且测试只是点击多次使用相同的下拉选项。this.uncheckColumns=function(limit){element(by.className('fa-cog')).click();element.a

javascript - 未捕获错误 : Mismatched anonymous define() module: function definition(name, 全局)

这个问题在这里已经有了答案:Mismatchedanonymousdefine()module(8个答案)关闭6年前。我在加载主干的requirejs文件时遇到了这个错误。我尝试加载r.js,requirejs优化器,但我仍然坚持使用它。UncaughtError:Mismatchedanonymousdefine()module:functiondefinition(name,global){"usestrict";varPubSub={name:'PubSubJS',version:'1.3.1-dev'以下是我的js:define(['jquery','underscore','

javascript - 为什么连续调用 `pattern.test(name)` 结果相反

这个问题在这里已经有了答案:WhydoesaRegExpwithglobalflaggivewrongresults?(7个答案)关闭7年前。为什么这段代码先返回true,然后返回falsevarpattern=newRegExp("mstea",'gi'),name="AmandaOlmstead";console.log('1',pattern.test(name));console.log('1',pattern.test(name));演示:Fiddle