草庐IT

kexec_load

全部标签

javascript - gapi.client.load 与 google.load

我对如何正确加载Google的API感到困惑。我看到提到了两种不同的方法:首先:GoogleAPI加载器(https://developers.google.com/loader)。我在html文档中看到这样使用:然后在JS文件中,它像这样使用:google.load('visualization','1.0',{'packages':['corechart']})第二:GoogleAPIJavascript客户端(http://code.google.com/p/google-api-javascript-client/)。这个加载如下:然后像这样使用:gapi.client.loa

javascript - jQuery 事件在 .load() 之后触发两次

我遇到过一个问题,即调用$.load()后jQuery事件会触发两次。事件处理程序放在load()回调函数中,这似乎是事件在脚本中触发两次的唯一地方。我尝试添加event.stopPropogation()和event.preventDefault(),因为这些似乎是触发多个jQuery事件的常见建议。我不确定我的代码是否冒泡不正确或什么。任何反馈都会有所帮助。以下是您看到该行为的部分代码的摘录。$("div.questions").load("question_source.php#simplified_a",function(){...//Line1$("#some_id").ch

javascript - attachEvent/addEventListener 到 Window onload/load - 首选方式

我有一个在页面加载时启动的脚本,我一直在使用下面的代码启动它:if(window.addEventListener){window.addEventListener('load',otherRelatedParts,false);}elseif(window.attachEvent){window.attachEvent('onload',otherRelatedParts);}但今天我尝试使用这样的自调用函数:(function(){otherRelatedParts();}())它似乎在所有浏览器中都有效,而且代码更少。这是将事件添加到窗口加载的首选方式吗?

javascript - 页面 Load 、 onload 和 $(document).ready() 之间的区别

我需要更详细地了解pageLoad、onload和$(document).ready()之间的区别我找到了答案,但我不是很清楚。答案就像ThereadyeventoccursaftertheHTMLdocumenthasbeenloaded,whiletheonloadeventoccurslater,whenallcontent(e.g.images)alsohasbeenloaded.TheonloadeventisastandardeventintheDOM,whilethereadyeventisspecifictojQuery.Thepurposeofthereadyeven

javascript - jQuery $(window).load 没有按预期工作

我今天在删除以前加载到我的Assets管道中但需要提取到部分以进行某些A/B测试的部分功能时遇到了一些没想到的事情。我正在使用bigVideo.js库在页面上加载全屏视频。今天,当我将代码提取到部分时,BigVideo.js开始加载错误的尺寸。部分加载低于我其余的javascriptAssets。我之前将代码封装在我的普通Assets管道中的匿名函数中。原始代码(有效)$(function(){(function(){varbgVid=new$.BigVideo({useFlashForFirefox:false})bgVid.show('http://videourl.com',{a

javascript - "JavaScript placed at the end of the document so the pages load faster"是吗?

这个问题在这里已经有了答案:关闭9年前。PossibleDuplicate:Javascriptonthebottomofthepage?我在一些推特Bootstrap示例中看到了一条评论。它说JavaScriptplacedattheendofthedocumentsothepagesloadfaster这是真的吗??如果是,那么它是如何工作的??

javascript - AMD 模块整形 : How to load only one JS function?

许多JavaScript库都有一个Builder工具,可以让您“塑造”您所依赖的库的哪些功能,无论是在客户端的下载带宽成本方面还是在隔离您实际需要的功能方面。例如,我喜欢sugar.js中的很多东西,但我根本不需要或不想处理片假名和平假名字符集。作为最简单的示例,我希望能够“塑造”sugar.js以仅导出string.isBlank()。是否有可用的工具为我执行此操作?EcmaScript委员会是否正在努力在未来的JavaScript版本中做这样的事情?是否有任何高级语言(如TypeScript和CoffeeScript)为此类“整形”提供隐藏支持?我可以通过monolinker在C#

javascript - Angular UI 路由器 : URL changed but view isn't loaded

我正在使用嵌套View开发我的UI-Router应用程序。我这样定义了一些状态:$stateProvider.state('parent',{url:"/parent",views:{'area1':{templateUrl:'parentView.html'},'area2':...//someotherareas+template}}).state('parent.child1',{url:"/child1",views:{'area1':{templateUrl:'child1View.html'},'area2':...//stillsomeotherareas,notchan

javascript - 卡斯珀JS : Why does my url change to about:blank when my page is loaded?

我是PhantomJS/CasperJS的初学者。我只想启动一个session并验证它是否正常。这是我的代码:varcasper=require('casper').create({verbose:true,logLevel:'debug',pageSettings:{loadImages:false,loadPlugins:false,userAgent:'Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/39.0.2171.71Safari/537.36Edge/12.0'}});ca

javascript - Chrome 扩展 : how to detect that content script is already loaded into a tab?

我的后台脚本中有以下代码:chrome.tabs.onUpdated.addListener(function(tabId,changeinfo,tab){if(changeinfo.status!=='complete')return;if(!matchesUrlFilters(tab.url))return;chrome.tabs.executeScript(tabId,{file:"jquery-1.7.1.min.js"},function(){chrome.tabs.executeScript(tabId,{file:"enhance.js"});});});但是,在某些情况