JavaScript中的作者时间和运行时有什么区别?我正在阅读YDKJS系列,作者一直提到作者时间,听起来我觉得作者时间是编写代码的时候,但我希望有人可以为我澄清一点.
上下文:这不是作者时绑定,而是运行时绑定.(来自YDKJ this&Object Prototypes)
我将我的应用程序部署到 Heroku,但在 Chrome 控制台中不断收到此错误:
bundle.js:11892 Mixed Content: The page at 'https://***.herokuapp.com/#/login'
was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint
'http://localhost:3000/login'. This request has been blocked; the content must
be served over HTTPS.(anonymous function) @ bundle.js:11892sendReq @
bundle.js:11653serverRequest @ bundle.js:11363processQueue @
bundle.js:16097(anonymous function) @ bundle.js:16113Scope.$eval @
bundle.js:17365Scope.$digest @ bundle.js:17181Scope.$apply @
bundle.js:17473(anonymous function) @ bundle.js:25159defaultHandlerWrapper @
bundle.js:3592eventHandler @ bundle.js:3580
bundle.js:11892 XMLHttpRequest cannot load http://localhost:3000/login. Failed
to start loading.
Run Code Online (Sandbox Code Playgroud)
这是我的服务器文件:
let express = require('express');
let app = express();
let publicRouter = …Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个字符串原型来检查字符串是否全部大写。这是我到目前为止所拥有的,我不确定为什么这不起作用。
String.prototype.isUpperCase = function(string) {
if(string === string.toUpperCase()) {
return true;
}else{
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
我希望它像这样工作:
'hello'.isUpperCase() //false
'Hello'.isUpperCase() //false
'HELLO'.isUpperCase() //true
Run Code Online (Sandbox Code Playgroud)