草庐IT

run_bear

全部标签

javascript - grunt.task.run() 不工作

我正在尝试在我的express应用程序中使用grunt。我有这样的东西:vargrunt=require('grunt');require(process.cwd()+'/gruntfile.js')(grunt);grunt.task.run('development');但是这个任务好像不行。(没有错误输出到控制台)但是,如果我直接在控制台“gruntdevelopment”中运行,它就可以正常工作。 最佳答案 grunt.task.run只是将一个任务添加到队列中,因此它可以在现有任务中运行,但不能在外部脚本中运行。这是我从g

javascript - Angular : Mixing provider and custom service in module's config/run

我想做这样的事情:angular.module('app',[]).config(['$httpProvider','customAuthService',($httpProvider,customAuthService)->$httpProvider.defaults.transformRequest.push(data)->ifcustomAuthService.isLoggedIndata['api_key']={token:@token}])根据Angularjsdoc,我不能在我的module的configblock中执行此操作,因为那里不允许自定义服务,我也不能在run中执

javascript - Vue.js "npm run build"但 Vue.js 未绑定(bind)到 DOM/工作

这里是Vue.js的新手。在MacOS上使用版本:$npm--version4.6.1$vue--version2.8.1我正在使用webpack-simpleinit和vue-cliforvue2.0。我在我的Django项目文件夹中为vue内容创建了一个名为frontend的文件夹。目录结构:$tree├──README.md├──asnew│  ├──__init__.py│  ├──migrations│  ├──models.py│  ├──settings.py│  ├──templates│ └──index.html│  ├──urls.py│  ├──views.py

javascript - 错误 : "Cannot find module" while running firebase cloud function

constfunctions=require('firebase-functions');varnodemailer=require('nodemailer');//constexpress=require('express');vartransporter=nodemailer.createTransport('smtps://username@gmail.com:password5@smtp.gmail.com');exports.sendMail=functions.https.onRequest((req,res)=>{varmailOptions={to:'receiver@

javascript - 为什么 npm react-scripts 在我运行 `npm run start` 时会产生语法错误?

这个问题在这里已经有了答案:SyntaxError:missing)afterargumentlist,Whenusingasync(3个答案)关闭3年前。所以我已经在全栈React应用程序上工作了几个月。出于某种原因,当我尝试在命令行上运行npmrunstart时,似乎不知何故,它产生了以下错误;//npmrunstart>pair@0.1.0start/Users/eden/Documents/GitHub/Pair./pair>react-scriptsstart/Users/eden/Documents/GitHub/Pair./pair/node_modules/react-

javascript - jQuery run 函数 onload 和 key up

我有以下内容,我想在页面加载时第一次运行。然后我希望它在用户进行更改时在keyup上运行。我想运行的函数非常大(为了在此处发布而被删除)所以我不想复制该函数。有没有办法调用函数onload然后在keyup上重用它?谢谢$(document).ready(function(){//thiscalculatesthesumforsometextnodes$("td,input").keyup(function(){varcol_1revenue=$(".Col1Receipts,.Col1Receiptsinput").sum();}//function);//keyup});//docu

javascript - map API v3 : Calculate bearing

我已经为此苦苦挣扎了一段时间,需要一些建议。我看过一些类似的主题,但找不到适合我的答案。我正在使用googlemapsAPI创建一个应用程序,它将确定您的位置,确定一个特定点(b点),然后移动箭头指向b点的方向。我在计算方位时遇到问题,有人可以提供帮助吗?我有:-a点的纬度/经度-b点的纬度/经度-设备知道北方在哪里,我能够计算出设备指向北方的度数我需要:一个计算将获取此信息并吐出一定数量的度数以指向箭头。我看过这里,这似乎很有用,但我仍然无法正常工作-它返回NaNhttp://www.movable-type.co.uk/scripts/latlong.html我不是真正的js专业人

javascript - 当我在 React 应用程序上执行 npm start 时,不断收到 "? Something is already running on port 3000"

当我启动我的react服务器时,我的终端中不断收到“?端口3000上已经有东西正在运行”消息,而我的端口3000上绝对没有任何东西正在运行我试图解决的问题:重新启动macOS。在chrome浏览器上检查我的“http://localhost:3000”。(无:无法访问此站点)转到chrome://serviceworker-internals和chrome://appcache-internals,搜索localhost:3000(未找到)我还尝试了几乎所有在Google上找到的与此问题相关的命令行我还创建了另一个express.js应用程序,它在端口3000上成功启动,而React说

javascript - MVC 3 : running javascript after validation has completed but before the actual post?

各位,我有一个MVC3数据输入表单场景,它要求用户在满足客户端验证之后,发送到服务器之前确认一些事情。有没有办法在验证框架允许回发之后,但在回发发生之前,将一些javascript插入到事件序列中?(当然,如果用户拒绝确认,回发也必须取消。)非常感谢。 最佳答案 可以订阅对应表单的.submit事件,判断是否有效:$(function(){$('form').submit(function(){if($(this).valid()){//clientvalidationpassedsuccessfully}else{alert('t

javascript - jpm run 不适用于 Firefox 48 或更高版本

jpm版本为1.1.3npm版本为2.15.8节点版本为4.4.7火狐版本为48.0index.js的内容:varself=require("sdk/self");console.log("************************************");“jpmrun”命令的输出JPM[info]StartingjpmrunonMyJetpackAddonJPM[info]Creatinganewprofile根据index.js文件的内容,控制台应该输出一行*符号。但是,愿望输出不在控制台中。代码有问题吗?我的package.json文件的内容:{"title":"My