草庐IT

active_var_mask

全部标签

javascript - 在 ajax 请求中使用 "var"关键字时非常奇怪的行为

我已经为此担心了一段时间,但我无法意识到到底发生了什么。代码注释中的解释。一个应用程序有2个版本,其中一个会抛出奇怪的结果,而第二个会执行预期的工作。varid="test1";$.post("http://fiddle.jshell.net/echo/json/",{"data":"data"},function(a){alert(id);//willthrowundefinedvarid="test2";alert(id);//willthrow"test2"asexpected});$.post("http://fiddle.jshell.net/echo/json/",{"da

javascript - maskedinput Uncaught TypeError : $(. ..).mask 不是函数

下午好我的有在“validacoes.js”文件中有$(document).ready(function(){$(".cpf").mask("999.999.999-99");$('.cpf').blur(function(){varid=$(this).attr("id");varval=$(this).val();varpattern=newRegExp(/[0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2}/);if(val.match(pattern)==null){$("#"+id+"_error").html("DigiteumCPF

javascript - jQuery 的 $(this).parent().parent().find ('.active' ) 的 Zepto.js 替代品是什么?

什么是Zepto.js替代jQuery的$(this).parent().parent().find('.active')? 最佳答案 这个问题大约有4个月了,Zepto框架会定期更新。$(this).parent().parent().find('.active')现在有效。根据gitrepo源代码树,此支持由MislavMarohnić(提交哈希784de340)于2010年12月20日添加。 关于javascript-jQuery的$(this).parent().parent()

javascript - iframe中的Angular js范围var值

我正在使用angularjs。我有一个Controller“youTubePlayerCtrl”,在这个Controller中我有$scope.videoID其中包含youtube视频ID。我能够在h1block的belowsdiv中获得此值。但我无法在iframe中获取{{videoID}},谁能帮我解决这个问题。{{videoID}}这是错误日志:[$interpolate:noconcat]http://errors.angularjs.org/undefined/$interpolate/noconcat?p0=http%3A%2F%2Fwww.youtube.com%2Fem

javascript - Angular ui router ui-sref-active on parent

我有一个父状态和许多子状态。如果我想让父级上的ui-sref-active在我在其中一个child身上时工作,我需要做这个“hack”:$scope.isActive=function(){return$state.includes('playLotteries.Index')||$state.includes('playLotteries.Group')||$state.includes('playLotteries.hunter');}这是非常丑陋的方式,而且我有很多child,所以这似乎不是一个好的解决方案。有人对此问题有其他解决方案吗? 最佳答案

javascript - 是否可以将 var styles = StyleSheet.create 从 React.component 分离到不同的脚本中?

是否可以在ReactNative中将varstyles=StyleSheet.create从React.component分离到不同的脚本中? 最佳答案 这是可能的。只需使用此模式创建一个js文件:'usestrict';varReact=require('react-native');varmyStyles=React.StyleSheet.create({style1:{},style2:{})}module.exports=myStyles;然后在您的组件js中使用require来使用该样式表,例如假设你的样式js文件被命名为

javascript - 使用 var self = 这是在类和事件之间同步的好方法吗?

让我们看一下这个简单的代码示例(为简单起见,它是用angularjs编写的,但这种情况在JavaScript中经常发生):angular.module('app',[]).directive('myDir',function(){this.state={a:1,b:2};return{link:function(scope,elem,attrs){elem.on('click',function(){//"this"isnottheclassbuttheelementthis.state.a++;this.state.b++;console.log(this.state);});}}}

javascript - 什么是 var {u,v,w} = x;在 Javascript 中是什么意思?

这个问题在这里已经有了答案:Whatdoescurlybracketsinthe`var{...}=...`statementsdo?(4个答案)关闭6年前。我在一段JS代码中看到过这个:var{status,headers,body}=res;它有什么作用?

javascript - 在函数中使用 let 而不是 var 的优点

这个问题在这里已经有了答案:Whatisthedifferencebetween"let"and"var"?(39个答案)关闭6年前。假设我有一段这样的代码:constnumber=3;functionfooFunction(){letnumberTwo=5;varanswer=number+numberTwo;returnanswer;}finalAnswer=fooFunction();console.log(finalAnswer);假设一个兼容ES2015的浏览器,使用上述代码的优点/缺点是什么,超过:constnumber=3;functionfooFunction(){va

javascript - Active Directory 集成问题 Nodejs

我是Nodejs的新手,我想使用AzureActiveDirectory进行身份验证。我按照提到的方式下载了Node并安装了NPMHerenpminstallexpressnpminstallejsnpminstallejs-localsnpminstallrestifynpminstallmongoosenpminstallbunyannpminstallassert-plusnpminstallpassportnpminstallpassport-azure-ad之后,根据文档,我遵循了第3步:设置您的应用以使用passport-node-js策略这是config.jsexport