草庐IT

re-initialized

全部标签

javascript - this.initialize(arguments) 与 this.initialize.apply(this, arguments) : what's the difference?

如果您查看Backbone.js的源代码,您会看到此模式的多种用途:this.initialize.apply(this,arguments);例如,这里:varRouter=Backbone.Router=function(options){options||(options={});if(options.routes)this.routes=options.routes;this._bindRoutes();this.initialize.apply(this,arguments);};为什么不直接写this.initialize(arguments)呢?

javascript - 传单 : Map container is already initialized does not get solved by proposed answers

我正在尝试使用传单加载map。当我刷新map时,出现上述错误。我研究了这个问题的其他建议答案。但是,他们中没有一个对我有用。我正在尝试在由onclick事件运行的函数中加载map。这是代码:functionload_map_and_analyze_data(){varmymap=L.map('mapid',{center:newL.LatLng(the_center_splitted[0],the_center_splitted[1]),maxZoom:17,minZoom:11,zoom:14});//creatingthemap//therestofanalyzeandcodego

javascript - 谷歌地图 JS v3 : Map display: none; after map initialization causing corrupted map

这当然涉及到之前关于初始化期间map显示的问题。然而这里的问题是在map应该已经初始化之后map显示被设置为无。我的widow.onload的最后一行将map设置为显示:无;到那时map初始化应该已经完成​​,但事实仍然是最终调用导致了问题。window.onload();函数...window.onload=function(){changeTheme(me);//doitnowsocurrent_themeisavaibletoswitchTabs();switchTabs("tab3");//setsmapdivvisibleinitMaps();//mapinitializat

javascript - angularjs ui-sortable : cannot call methods on sortable prior to initialization; attempted to call method 'refresh'

我正在尝试对列表进行排序,我从数据库中获取元素但是...Error:cannotcallmethodsonsortablepriortoinitialization;attemptedtocallmethod'refresh'我的html:{{item.Title}}还有我的Controller:functionmenuConfigCtrl($location,$scope,menuFactory){$scope.menu=[];menuFactory.getMenu().success(function(data){$scope.menu=data;});}我的getMenu()是:

javascript - Initiate Masonry - 在无限滚动和参数搜索之后

AJAX和Masonrygrid有问题.砌体网格很简单,没有在正确的时间启动。在滚动或使用参数搜索转到特定类别之前,效果非常好。可以找到示例站点here.砌体Masonry是一个JavaScript网格布局库。通常与Bootstrap或其他未正确对齐项目的网格系统一起使用。示例:仅自举:引导和砌体:滚动时下一列将添加到旧列之上。提供与unloadedimages几乎相同的输出这使得图像重叠。这通常可以通过使用我已经包含在提供的代码中的imagesLoaded来解决。使用参数搜索时Masonry在AJAX之后没有被解雇。这意味着它根本不起作用。所以柱子在没有砌体的情况下被加载。请参阅sa

javascript - ES6 : Re-defining exported function

给定一个导出函数并在其内部逻辑中使用该函数的第3方库-是否有任何方法可以重新定义该函数?例如:third-party.jsexportfunctiona(){console.log('a');}exportfunctionb(){a();}我的模块.jsimport*astpfrom'third-party';//Re-define,somethinglikethisObject.defineProperty(tp,'a',{writable:true,value:()=>console.log('c')});//Callbandgetthere-definefunctioncalle

javascript - jQueryUI 1.9 : how to check for widget initialized (cannot call method prior to initialization)

我目前正在将一些代码从1.8迁移到1.9.2,我面临着小部件在初始化之前被销毁的情况。例如,现在在1.9.2中以下可能是错误的(抛出异常):有什么方法可以检查调用是否可行:$div.buttonset("destroy") 最佳答案 您可以使用$element.data("widget-name")检查小部件是否存在,然后调用您想要的。小部件的正确名称是命名空间+破折号+插件名称。例如:ui-tabs、ui-dialog等在我的项目中,我有一个全名为mediaITPro.player的小部件。传递给数据调用的正确名称是“mediaI

javascript - "The property or field ' 尝试通过 JavaScript 访问 SharePoint 中库的 GUID 时 ID ' has not been initialized. It has not been requested..."

我正在尝试使用SharePoint2013中的客户端对象模型访问库的ID。但出现错误:Thepropertyorfield'Id'hasnotbeeninitialized.Ithasnotbeenrequestedortherequesthasnotbeenexecuted.Itmayneedtobeexplicitlyrequested.下面是我的代码:varcontext=SP.ClientContext.get_current();varweb=context.get_web();varitems=SP.ListOperation.Selection.getSelectedIt

javascript - react / Hook : prevent re-rendering component with a function as prop

假设我有:constAddItemButton=React.memo(({onClick})=>{//Goalistomakesurethisgetsprintedonlyonceconsole.error('ButtonRendered!');returnAddItem;});constApp=()=>{const[items,setItems]=useState([]);constaddItem=()=>{setItems(items.concat(Math.random()));}return({items.map(item=>{item})});};每当我添加一个项目时,重新呈

javascript - Ember.js 弃用 registerImplementation 以支持 App.initializer

我正在使用HashLocation的扩展来实现Ember.js的hashbangurl类型。这是代码片段:(function(){varget=Ember.get,set=Ember.set;Ember.Location.registerImplementation('hashbang',Ember.HashLocation.extend({getURL:function(){returnget(this,'location').hash.substr(2);},setURL:function(path){get(this,'location').hash="!"+path;set(t