草庐IT

anchor_property

全部标签

javascript - IE 11 浏览器错误 - 异常 : Object doesn't support property or method 'matches' , 其他浏览器工作正常

就我而言,该网页在firefox和chrome浏览器中运行良好,但在IEv.11中它显示错误为errorcomesinIE11DEVELOPERTOOLS.该错误显示在IE11的开发人员工具中。该错误不允许打开特定链接,单击它会显示以下错误。polyfills.ts-*BROWSERPOLYFILLS*//**IE9,IE10andIE11requiresallofthefollowingpolyfills.**/import'core-js/es6/symbol';import'core-js/es6/object';import'core-js/es6/function';impo

javascript - 错误 :InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number

functioninitAutocomplete(){varlat=document.getElementById('lat').value;varlng=document.getElementById('lng').value;console.log(lat);console.log(lng);varmap=newgoogle.maps.Map(document.getElementById('map'),{center:{lat:lat,lng:lng},zoom:13,mapTypeId:'roadmap'});}它给了我以下错误:error:InvalidValueError:

javascript - 自定义过滤器在 AngularJS 中给出 "Cannot read property ' 切片' of undefined"

我的自定义startFrom过滤器给我一个错误。app.filter('startFrom',function(){returnfunction(input,start){start=+start;//parsetointreturninput.slice(start);}});app.controller("PostCtrl",function($scope,$http){$scope.currentPage=0;$scope.pageSize=10;$scope.hidePagination=true;$scope.search=function(){$http.get('some

JavaScript - 跳转到 anchor

我正在尝试打开一个跳转到anchor的div。开头部分有效,但没有跳转到指定的anchor这是我的脚本:functionspoil(id){if(document.getElementById){vardivid=document.getElementById(id);divid.style.display=(divid.style.display='block');window.location='#'+id;}}有什么问题吗?干杯。 最佳答案 您尝试过window.location.hash='#'+id;吗?

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

我正在尝试使用.getElementsByTagName()选择元素。vartags=document.body.getElementsByTagName("*");当前尝试使用从现有答案中吸取的教训https://stackoverflow.com/questions/7410949/javascript-document-getelementsbyclassname-compatibility-with-ie/7410966#7410966但是我的尝试失败了,出现了这个错误:UncaughtTypeError:Cannotreadproperty'getElementsByTagN

javascript - 类型错误 : Cannot create property 'validator' on string 'abc@gmail.com' at setUpControl

我在formGroup中遇到问题。首先,我根据URL取一些值并调用API来检索前字段文本的特定用户数据。注册.htmlUsername注册.component.tsimport{Component}from'@angular/core';import{FormGroup,AbstractControl,FormBuilder,Validators}from'@angular/forms';import{Router,ActivatedRoute}from'@angular/router';import{EmailValidator,EqualPasswordsValidator}fro

javascript - 如何在没有框架的情况下将点击绑定(bind)到 anchor (javascript)

我知道这在jQuery或任何其他框架中很容易完成,但这不是重点。如何在纯javascript中“正确”绑定(bind)点击事件?我知道如何内联(我知道这很糟糕)clickhere这会导致我的javascript在支持JS的浏览器中执行,而链接在没有javascript的浏览器中表现正常?现在,我如何以非内联方式做同样的事情? 最佳答案 如果你只需要分配一个click事件,你可以分配onclick:如果您有身份证:myAnchor=document.getElementById("Anchor");myAnchor.onclick=f

javascript - Vue-路由器错误: TypeError: Cannot read property 'matched' of undefined

我正在尝试编写我的第一个Vuejs应用程序。我正在使用vue-cli和simple-webpackboilerplate.当我将vue-router链接添加到我的应用程序组件时,我在控制台中收到此错误Errorinrenderfunction:"TypeError:Cannotreadproperty'matched'ofundefined"这是我的代码:App.vueLinksHomeQueryexportdefault{}ma​​in.jsimportVuefrom'vue'importVueRouterfrom'vue-router'Vue.use(VueRouter)impor

javascript - 未捕获的类型错误 : Cannot set property playerNo of# which has only a getter on line 4

我正在从使用旧的(函数和原型(prototype))hackyJavaScript类转向使用新的ES6类。我可能正在做一些愚蠢的事情,但我不确定为什么不允许我这样做:classPlayer{constructor(playerNo){this.playerNo=playerNo;}getplayerNo(){returnthis.playerNo;}setcards(playersCards){this.cards=playersCards;}getcards(){returnthis.cards;}}varsteve=newPlayer(1);它给我错误:UncaughtTypeEr

javascript - react 路由器未捕获类型错误 : Cannot read property 'toUpperCase' of undefined

我正在尝试使用react-router,但是当我编写一个简单的路由时它不起作用并且控制台显示UncaughtTypeError:Cannotreadproperty'toUpperCase'ofundefined。否则,当我在没有运行良好的react-router的情况下使用时varReact=require('react');varReactRouter=require('react-router');varRouter=ReactRouter.Router;varRoute=ReactRouter.Route;varApp=React.createClass({render:fun