草庐IT

Property_Tree

全部标签

javascript - 与 Aurelia 的属性(property)变更订阅

我的viewmodel上有一个属性,我想监听它并根据它的值触发事件,如下所示:classviewModel{constructor(){this.value='0';letval=2;subscribe(this.value,callbackForValue);subscribe(val,callbackForVal);}}这是Aurelia的功能吗?如果是这样,我将如何设置这样的订阅? 最佳答案 在一些插件中,我一直在使用DI从容器中获取ObserverLocator实例:import{inject}from'aurelia-de

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

我有这段代码给我奇怪的错误信息UncaughtTypeError:Cannotsetproperty'position'ofundefined这是一个jQuery插件的内部,用于在弹出窗口中显示谷歌地图。我在其他地方使用代码,在那里工作正常-这里唯一的区别似乎是我现在在弹出窗口中使用它。我是否遗漏了范围问题或其他问题?所有变量(如geocoderParams和latlng)都按应有的方式填充。谷歌搜索错误消息没有发现任何有值(value)的信息。调用google.maps.Map()时会触发错误消息。self=$(this)self.hide()geocoder=newgoogle.m

javascript - 如何修复未捕获的 InvalidValueError : setPosition: not a LatLng or LatLngLiteral: in property lat: not a number?

我正在尝试将我的googlemapsv2功能移植到v3。但不知何故我陷入了一个奇怪的错误,我找不到我做错了什么。Error:UncaughtInvalidValueError:setPosition:notaLatLngorLatLngLiteral:inpropertylat:notanumber%7Bmain,adsense,geometry,zombie%7D.js:25这里是我的map初始化:varmap=newgoogle.maps.Map(document.getElementById("map"),{zoom:4size:newgoogle.maps.Size(580,4

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

我在这段代码中遇到错误,我正在尝试执行一个事件,当页面加载时,它将执行该事件。但问题是当我转到其他功能时,但在同一页面上,它在该变量上出现null错误。当我执行这段代码时没有问题,但是当我在我的代码的其他部分时,就会发生这个错误。UncaughtTypeError:Cannotreadproperty'value'ofnull$(document).ready(function(){varstr=document.getElementById("cal_preview").value;varstr1=document.getElementById("year").value;varst

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

我收到此错误,它源自jquery框架。当我尝试在准备就绪的文档上加载选择列表时,出现此错误。我似乎无法找到我收到此错误的原因。它适用于更改事件,但我在尝试手动执行该功能时遇到错误。UncaughtTypeError:Cannotreadproperty'toLowerCase'ofundefined->jquery-2.1.1.js:7300这是代码$(document).ready(function(){$("#CourseSelect").change(loadTeachers);loadTeachers();});functionloadTeachers(){$.ajax({ty

javascript - IE9 JavaScript 错误 : SCRIPT5007: Unable to get value of the property 'ui' : object is null or undefined

我的网站在Chrome、Firefox和InternetExplorer8上运行良好。但在InternetExplorer9上,将鼠标悬停在组件上时会触发非常奇怪的错误。SCRIPT5007:Unabletogetvalueoftheproperty'ui':objectisnullorundefinedScriptResource.axd?d=sTHNYcjtEdStW2Igkk0K4NaRiBDytPljgMCYpqxV5NEZ1IEtx3DRHufMFtEMwoh2L3771sigGlR2bqlOxaiwXVEvePerLDCL0hFHHUFdTOM0o55K0&t=ffffff

javascript - 将 youtube 中的 url 替换为嵌入代码 - 错误 : Permission denied to access property 'toString'

我在FireBug中有这段代码和这个错误:Error:Permissiondeniedtoaccessproperty'toString'我该如何修复这个错误?HTML:http://www.youtube.com/watch?v=UNMLEZrukRUJS:$("div.yturl").each(function(){varregex=/(\?v=|\&v=|\/\d\/|\/embed\/|\/v\/|\.be\/)([a-zA-Z0-9\-\_]+)/;varyoutubeurl=$(this).text();varregexyoutubeurl=youtubeurl.match

javascript - getElementsByClassName 和 IE8 : Object doesn't support this property or method

这个问题在这里已经有了答案:javascriptdocument.getElementsByClassNamecompatibilitywithIE(7个答案)关闭8年前。我知道IE8不支持“getElementsByClassName”。你知道我可以用什么代替吗?我因错误而烦人"Objectdoesn'tsupportthispropertyormethod".HTML代码是:functionsumar(){varelems=document.getElementsByClassName('verdana14toAdd');varmyLength=elems.length;total

javascript - 未捕获的类型错误 : Cannot assign to read only property

我正在尝试NicholasZakas所著的“面向Web开发人员的专业JavaScript”一书中的这个非常简单的示例,但我不知道我在这里做错了什么。一定是我错过的非常简单的东西,但我被卡住了。代码如下:'usestrict';varbook={};Object.defineProperties(book,{originYear:{value:2004,writable:false},_year:{value:2004},edition:{value:1},year:{get:function(){returnthis._year;},set:function(newValue){if(

javascript - 脚本 438 : Object doesn't support property or method IE

我的应用程序中有一个选项,用户可以在其中停用他们的个人资料。只有管​​理员可以再次激活它们。我有一个类ActivateProfile有两个方法userExist(userName)检查具有该用户名的用户是否存在以及他/她的个人资料是否已停用和activateAccountByUser(userName)再次激活用户的个人资料我在输入类型按钮的点击事件上调用JavaScript函数。此代码在Chrome和Mozilla上运行良好,但在InternetExplorer上出现此错误:SCRIPT438:Objectdoesn'tsupportpropertyormethoduserExist