草庐IT

windows-8-mail-app

全部标签

javascript - window.onload 在 Firefox+Greasemonkey 脚本中有效,但在 Chrome 用户脚本中无效?

有一个页面http://example.com/1.php像往常一样包含javascript文件:此文件包含名为exampleFunction的函数,我需要在我的用户脚本中使用它。我还有一个用户脚本://==UserScript==//@nameSomeName//@namespacehttp://example.com/userscripts//@descriptionGreetstheworld//@includehttp://example.com/*//==/UserScript==window.onload=function(){console.log(exampleFunc

【uni-app】点击左上角返回按钮,弹出弹窗或者是携带参数返回上一页

目录1、弹出弹窗2、把这一页的数据带回到上一页(获取下一页的数据)3、跳转页面并携带参数,接受页获取参数1、弹出弹窗当我返回上一页的时候需要做一个判断是否需要保存onBackPress只支持APP和H5但不支持小程序,可以用onUnload生命周期解决,页面销毁的时候执行方法。注意:onBackPress和methods、onLoad同级data(){ return{ flag:true//是否弹出返回提示框 }},onBackPress(){ if(this.flag){ uni.showModal({ title:"确定退出编辑?", content:"退出后内

javascript - Express Middleware 为所有 app.get() 填充一个 Jade 变量

我有一个名为layout.jade的Jade文件,我的所有模板都对其进行了扩展。如果用户当前已登录(这在req.session中保持跟踪),我希望能够在其中有一个注销按钮。所以layout.jade会有类似的东西,-if(loggedin)a.navButton(href="/logout")LogOut页面的路由看起来像,app.get("/foo",function(req,res){res.render("foo",{loggedin:req.session.isValidUser});});问题是,我不想在每条路由中都手动填充loggedin变量。有没有一种方法可以使用Expr

javascript - app.configure(function){} typeerror undefined is not a function

我正在使用socket.io和angularjs创建一个聊天应用程序,当我使用cmd运行app.js文件时,我收到一条错误消息“app.configure(function){}typeerrorundefinedisnotafunction”可能是什么问题?我的代码是这样的:varhttp=require('http');varexpress=require('express'),routes=require('./routes'),socket=require('./routes/socket.js');app=module.exports.app=express();varser

javascript - ngStorage 和 $window.localStorage 的区别

ngStorage和$window.localStorage有什么区别?什么时候用一个比另一个更好?我必须为网络应用程序选择其中之一。我必须保存配置文件用户和token的数据 最佳答案 这是正常的html5本地存储:Withlocalstorage,webapplicationscanstoredatalocallywithintheuser'sbrowser.BeforeHTML5,applicationdatahadtobestoredincookies,includedineveryserverrequest.Localsto

javascript - Window.open location =no 不起作用

我需要在我的网络应用程序中创建一个弹出窗口来加载一个统一文件。为此,我使用Javascript的Window.Open。​​我不希望用户看到弹出窗口的URL或让他有机会更改URL。根据这个链接:http://javascript.about.com/library/blpopup10.htm"locationcanbesettoyesornotoindicatewhetherornotthenewwindowshoulddisplaythelocationoraddressbar.Notethatthisisarecommendationonlyassomebrowserssuchas

javascript - 在 nodejs 代码中使用 window.crypto

我正在尝试在nodejs脚本中使用window.crypto.getRandomValues方法。据我了解,当我在Node中运行这样的简单代码时,没有window元素:vararray=newUint32Array(10);window.crypto.getRandomValues(array);这就是我收到此错误的原因:ReferenceError:windowisnotdefined如何在我的代码中使用这个方法?谢谢 最佳答案 您可以使用内置的crypto模块代替。它同时提供了crypto.randomBytes()以及cryp

javascript - Angular 中的 $document 和 $window.document 有什么区别?

我在JSBin中试了下面的代码,第一个可以拿到canvas对象。但是,第二个不能。JSBin:http://jsbin.com/natavejasa/1/edit?html,js,outputvarcanvas=$window.document.getElementById('myCanvas');JSBin:http://jsbin.com/yareb/1/edit?html,js,outputvarcanvas=$document.getElementById('myCanvas');所以我想知道$window.document和$document之间有什么区别。

javascript - 你如何在 Windows 上的 node.js 中运行外部程序?

我正在Windows上使用node.js创建一个自动化的网络应用程序构建过程。我正在尝试通过Google闭包java程序运行我们的代码。我阅读了Node文档中关于child_process的文档。它提到它还不能在Windows中工作。是否有解决此问题的软件包或解决方法?这是我正在尝试运行的代码。var_exec=require('child_process').exec;_exec('java'+'-jar'+COMPILER_JAR+'--js'+srcPath+'--js_output_file'+distPath,function(e){echo("googleclosuredo

javascript - “window.open”被 Firefox 阻止

我使用window.open并在文档ready事件中调用它,但它被Firefox中的弹出窗口阻止程序阻止。然后我将它添加到函数中并从一个按钮调用这个函数然后触发按钮点击但没有成功:$(function(){abcd();});functionabcd(){varpopup=window.open("http://localhost/johndyer-mediaelement-7ed6c51/demo/index.php","mypopup","width=500,height=300");}有没有什么方法可以在页面加载时在浏览器上打开一个外部弹出窗口或新标签页?