草庐IT

METHOD_NAME

全部标签

javascript - ES6 模块语法 : is it possible to `export * as Name from ...` ?

参见问题标题。我找到了一个greatreferenceexport的形式可用,但我还没有看到我要找的东西。是否可以像下面那样做?//file:constants.jsexportconstSomeConstant1='yay';exportconstSomeConstant2='yayayaya';//file:index.jsexport*asConstantsfrom'./constants.js';即这将在index.js中提供一个命名导出Constants,其中包含来自constants.js的所有命名导出。Thisanswer似乎表明这在TypeScript中是不可能的;纯J

javascript - jQuery 用户界面 - 错误 : cannot call methods on dialog prior to initialization; attempted to call method 'open'

这个问题在这里已经有了答案:jqueryuiDialog:cannotcallmethodsondialogpriortoinitialization(11个答案)关闭6年前。[已解决]我写这个脚本。不幸的是,jQuery控制台抛出:Error:cannotcallmethodsondialogpriortoinitialization;attemptedtocallmethod'open'我使用jQuery1.10.2和jQueryUI1.10.4。$(function(){$("#player").on('click','img',function(){varzadanie=$("

javascript - CSS 和 JQuery : spaces inside image name break code of url()

我有一个页面,当鼠标悬停在缩略图上时,该页面应该显示图像的放大版本。我有一个带有ID的“div”,JQuery代码如下:$(document).ready(function(){$('img').hover(function(){varsrc=$("#im"+this.id).attr("src");$('#viewlarge').css('backgroundImage','url('+src+')');returnfalse;});});我使用的图像是由Ruby脚本生成的,该脚本“生成”具有相似但不同ID的图像。但是,有时上传的照片内部有“空格”。我的开发人员工具告诉我背景图片设置

Javascript -> Flash 抛出 "Error calling method on NPObject"

我正在尝试从Javascript调用Flash(AS3)函数。代码运行时,出现错误“错误:未捕获的异常:在NPObject上调用方法时出错!”从我一天的谷歌搜索来看,这似乎是一个安全问题,我已经做了我能找到的一切,但错误仍然出现。一些细节:*Flash9和Flash10播放器都会出现这种情况。*swf与加载它的php文件位于同一域中,该文件包含试图调用Flash函数的javascript。*我正在使用sfwobject2.2加载swf文件,如下所示:varflashvars={};varparams={};varparams={menu:false,bgcolor:"#ffffff",

javascript - meteor .js : how to call helper method from event?

我怀疑我没有按照Meteor的方式来做这件事。我正在制作一个共享的交互式日历。我有一个日历模板:Calendar{{#eachdays}}{{>day}}{{/each}}使用返回日期对象的助手:{date:thisDate.getDate(),dateString:dateString,done:done,today:isToday}我有一天模板:{{date}}有一些帮助者(meetingID目前为开发硬编码):Template.day.helpers({state:function(){//retreivefromDBvars=Meetings.findOne({"_id":me

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

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

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 - 这个错误 "Declaration of instance field not allowed after declaration of instance method."是什么意思

在我的Angular2项目中,我收到此错误:“在声明实例方法之后不允许声明实例字段。相反,这应该出现在类/接口(interface)的开头。(成员排序)”我想了解如何解决这个问题以及我为什么会遇到这个问题。错误与下一段代码中的私有(private)函数有关:exportclassHomeComponentimplementsOnInit{publicerror:string;publicshirts=[];constructor(publicrest:RestService,publicscService:ShoppingCartService,publicsnackBar:MdSna

javascript - 为什么我有这个错误 : Object doesn't support property or method 'forEach' for Internet Explorer?

我正在使用maven在jenkins插件上使用Javascript,我有以下代码:functionarrayElements(element,index,array){vararrayPaths=element.split("\\");varprojectSource=arrayPaths[2];vararray=element.split("_");if(projectSource===global){if(array[2]===filtro){document.getElementById("source").options.add(newOption(arrayPaths[3],

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','