草庐IT

windows - 引导时 Vagrant \'remote connection disconnect\'

全部标签

javascript - electron 的 remote.getGlobal() 在 window.location.replace() 之后返回 "undefined"

我一直在摆弄Electron的远程模块。在我的主进程中,我创建了这个变量:global.storage={};我的渲染器进程是用一个名为startup.html的文件初始化的。win.loadURL('file://'+__dirname+'/startup.html')在那里,我包含了一个包含以下函数的javascript文件:functionenterMain(value){remote.getGlobal('storage').exmpl=value;window.location.replace('./general.html');}我传递的值是“hello”,当调用...co

javascript - 从 Window.location.hash 创建数组

我正在尝试从window.location.hash变量创建数组,但我失败了。我的代码是:$.each(window.location.hash.replace("#","").split("&"),function(i,value){value=value.split("=");varmy_item={value[0]:value[1]};form_data[i]=my_item;});console.log(form_data);谢谢。 最佳答案 试一试:varhash=window.location.hash.slice(1)

javascript - 为什么 window.onload 有效而 document.onload 无效?

谁能告诉我为什么以下页面在加载时不会触发警报?如果我使用window.onload而不是document.onload它会起作用。为什么会有这种差异?document.onload=function(){alert('Test');} 最佳答案 最简单的答案是它不是那样设计的。浏览器在“endofthedocumentloadingprocess”处执行附加到window.onload的函数。它不会尝试执行附加到document.onload的函数。您可以将函数分配给document.onload,但浏览器不会对其执行任何特殊操作。

javascript - 延迟后如何在 window.onload 中加载 javascript 函数

我有几个函数应该在onload事件延迟后触发。它在chrome中运行良好,但在Firefox中运行不正常。functionfoo(){//javascriptcode}window.onload=setTimeout(foo,delay);functionbar(){//javascriptcode}window.onload=setTimeout(bar,delay);如果我删除延迟,“bar”会在Firefox中调用,而“foo”和“bar”会在chrome中调用。这可能是什么问题? 最佳答案 我很惊讶这两个函数在任何浏览器中都

javascript - 从 iFrame/Window 访问 JavaScript 中的父对象

如何在子窗口中访问定义在父窗口中的全局对象或数组。varevents_data;functionfunction_to_fill_events_data(){...}当我在迷你文档中时,我希望能够访问javascript函数中的events_data变量。 最佳答案 选项1您的标题提到了一个子窗口。如果你有一个子窗口,而不是一个iframe,使用这个:window.opener.events_data查看window.openeronMDN.选项2您的代码表明您使用的是iframe。在iframe中,只需使用parent:paren

javascript - 对象不支持 Internet Explorer 10 (Windows 8) 中的属性或方法 'transformNode'

我遇到了一些JavaScript问题,这些问题似乎只发生在Windows8上的InternetExplorer10中(IE7、8和9都可以正常工作)。我所做的基本工作是从Web服务获取XML和XSL,然后在JavaScript中转换它们以使用Sys.Net.XMLDOM对象呈现在页面上。XMLDOM=Sys.Net.XMLDOM;varxsl=//XSLgottenfromsomewhereelsevarxmlString=//XMLgottenfromsomewhereelseasastring...varxml=newXMLDOM(xmlString);varcontent=xml

javascript - Window.open 调整到可用的宽度和高度

我已经做了一些搜索,但我看不出这是否可行。我想使用window.open()方法打开指向窗口可用宽度和高度的链接。类似于下面的代码。varh=$(window).height();varw=$(window).width();$('#window-opener').live('click',function(e){window.open(this.href,'Resource','toolbar=no,location=0,status=no,titlebar=no,menubar=no,width='+w',height='+h);e.preventDefault();});这可能吗

javascript - window.title 和 document.title 的区别

我一直在阅读有关JavaScript的Material,有两种方法可以访问页面的title:window.title属性document.title属性但是在申请的时候,第二个才有效。我无法理解为什么有两个标题以及为什么它们都不起作用。 最佳答案 window.document.title是正确的。window.title不正确,因为thewindowobjectdoesn'thaveatitleproperty(窗口的所有属性都在左侧下方,您会看到title不存在)。 关于javasc

javascript - 无法将引导模式窗口作为路线打开

我正在使用bootstrap来显示模式,并希望它在单击anchor标记时显示为路由。但是我遇到了一个模块错误并且似乎无法弄清楚如何解决它。HTMLClickheretoopenmodal!JSvarapp=angular.module('plunker',['ui.bootstrap']);app.config(function($routeProvider){$routeProvider.when('/profile',{templateUrl:'modalContainer',controller:'ProfileModalCtrl'});})app.controller('Det

javascript - 如何检测 angularJS 中的引导日期时间选择器更改事件

我正在以Angular使用这个日期时间选择器。https://eonasdan.github.io/bootstrap-datetimepicker/在我的Controller内部:$('#picker').datetimepicker();在我的HTML中我有:一切都由Controller“AppController”管理。问题是,当我通过单击在日历上选择一个日期时,它不会触发任何“更改”事件(换句话说,不会触发datechange)。如果我在ng-model“adate”上做watch,它似乎也不会触发它。如果我在文本框中键入内容,则范围变量会发生变化。如果用户单击选择器中的日期进