草庐IT

is_undefined

全部标签

javascript - 是什么导致错误 "Uncaught TypeError: number is not a function"

我有一个更新表单的onchange事件,在更新过程中它调用一个函数来计算运费。我不确定为什么,但是当我尝试调用该函数时出现以下错误:未捕获的类型错误:数字不是函数shipping函数如下所示:functionshipping(weight){varflatswitch(weight){case1:case2:case3:flat=32.00;break;case4:flat=18.50;break;case5:flat=15.80;break;case6:flat=14.00;break;case7:flat=12.71;break;case8:flat=11.75;break;cas

javascript - 'is an instance of' 在 Javascript 中是什么意思?

这个问题的答案:WhatistheinitialvalueofaJavaScriptfunction'sprototypeproperty?有这样一句话:Theinitialvalueofprototypeonanynewly-createdFunctioninstanceisanewinstanceofObject据我所知,Javascript没有类,因此“实例”这个词在我脑海中没有意义。应该如何解释Javascript中的“实例”?抱歉,我没有足够的代表将我的问题放在该答案的评论线程中。 最佳答案 你说得对,JavaScript

javascript - 'undefined' 不是在 Safari 中评估 el.click() 的函数

我想在按下Enter按钮时运行一个js函数。在IE、Chrome和Opera中一切正常,但在Safari中出现错误(如下所述)。我需要一个纯Javascript解决方案,不是jQuery。这是函数:functionpressSearch(e){if(typeofe=='undefined'&&window.event){e=window.event;}varcharCode=(e.which)?e.which:((e.charCode)?e.charCode:((e.keyCode)?e.keyCode:0));if(charCode==13){document.getElementB

javascript - react native v0.56 : Cannot read property 'filename' of undefined at PluginPass. JSXOpeningElement

我刚刚将ReactNative从0.55更新到0.56。但是,当我尝试运行代码(react-nativerun-android或run-ios)时,捆绑停止到这一点:Loadingdependencygraph,done.error:bundlingfailed:TypeError:Cannotreadproperty'filename'ofundefinedatPluginPass.JSXOpeningElement({path_to_my_project}/react-native/node_modules/babel-plugin-transform-react-jsx-sour

javascript - 未捕获的类型错误 : Property '$' of object [object DOMWindow] is not a function

我的脚本在Chrome中出现:UncaughtTypeError:Property'$'ofobject[objectDOMWindow]isnotafunction错误。functionshowSlidingDiv(){$("#slidingDiv").fadeToggle("slow","linear");}functionshowSlidingDiv2(){$("#slidingDiv2").fadeToggle("slow","linear");}functionshowSlidingDiv3(){$("#slidingDiv3").fadeToggle("slow","lin

javascript - 将 window 和 undefined 传递给立即调用的匿名函数。为什么?

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:whydoweneedtopassinwindowandundefinedintothisjqueryplugin?我看过jQuery源代码是这样做的:(function(window,undefined){...}(window))我明白为什么包含undefined是有用的,如果有人以前在哪里更改“undefined”。但是窗口不能改变。据我所知,它甚至不需要使用,对吧?这有什么用?

javascript - Uncaught ReferenceError : $ is not defined

我在尝试创建JQuery图像slider时收到此错误消息。UncaughtReferenceError:$isnotdefined这是我的新编码(注意我已将脚本移至页面的底部,这是adobe建议的。):GreenCold-FormedSteel|Homebody,td,th{font-family:Tahoma,Geneva,sans-serif;font-size:10px;color:#000;text-align:left;}body{background-color:#999;}a:link{color:#999;text-decoration:none;}a:visited{

javascript - AngularJS/Restangular routing "Cannot set property ' route' of undefined"

我有一个基于AngularJS的前端,它使用restangular从我构建的Django后端获取记录。我正在调用以下客户列表:varapp;app=angular.module("myApp",["restangular"]).config(function(RestangularProvider){RestangularProvider.setBaseUrl("http://172.16.91.149:8000/client/v1");RestangularProvider.setResponseExtractor(function(response,operation){retur

javascript - Google Maps API v3 热图错误 : "Cannot read property ' HeatmapLayer' of undefined"

我正在尝试将Heatmaps图层加载到我的谷歌地图上,但出于某种原因,我一直收到错误消息“无法读取未定义的属性‘HeatmapLayer’。”map=newgoogle.maps.Map(document.getElementById("gmaps"),{zoom:11,center:newgoogle.maps.LatLng(39.788403,-86.19990800000001),mapTypeControl:false,streetViewControl:false,mapTypeId:google.maps.MapTypeId.ROADMAP,panControl:false

javascript - 使用 chrome.notifications.create 时出错 "Uncaught TypeError: Cannot read property ' create' of undefined"

您好,我在chrome应用的js函数中调用chrome.notifications.create时出错。可以在函数外部正常使用,但在函数内部时出现以下错误:UncaughtTypeError:Cannotreadproperty'create'ofundefined代码如下:document.addEventListener('DOMContentLoaded',function(){document.getElementById('submit').addEventListener('click',submit);});functionsubmit(){varoptions={typ