有没有办法阻止用户看到他们试图拖动的图像的鬼魂(不关心图像的安全性,而是体验).
我试过这个解决了文本和图像上的蓝色选择而不是重影图像的问题:
img {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
}
Run Code Online (Sandbox Code Playgroud)
(我也尝试将图像嵌入div中,并将相同的规则应用于div).谢谢
当我做:
lib = require('lib.js')(app)
Run Code Online (Sandbox Code Playgroud)
在app
实际歌厅通过呢?
在lib.js中:
exports = module.exports = function(app){}
Run Code Online (Sandbox Code Playgroud)
似乎没有,因为当我尝试做的不仅仅是(app)
,而是做:
lib = require('lib.js')(app, param2)
Run Code Online (Sandbox Code Playgroud)
和:
exports = module.exports = function(app, param2){}
Run Code Online (Sandbox Code Playgroud)
我没有params2
.
我试图通过以下方式进行调试:
params = {}
params.app = app
params.param2 = "test"
lib = require("lib.js")(params)
Run Code Online (Sandbox Code Playgroud)
但在lib.js中,当我尝试JSON.stringify
收到此错误时:
"DEBUG: TypeError: Converting circular structure to JSON"
Run Code Online (Sandbox Code Playgroud) 也许我不理解javascript/coffee脚本以及我想但当我这样做时:
that.thing = thing
that.thing.title = "some title"
console.log(that.thing.title)
console.log(JSON.stringify(that.thing)
Run Code Online (Sandbox Code Playgroud)
我得到输出:
一些头衔
{ "CREATION_DATE": "2011-09-09T00:40:03.742Z", "_ ID": "4e6960638ec80519a0000013"}
问题是当我执行stringify时,我似乎失去了title属性(稍后当函数存在时,我似乎有其他有趣的问题,我认为这与'that'和嵌套在多个fxn调用中有关).
(我现在必须做一个丑陋的解决方案,我做那个.thing = {}来解决我的问题.我必须解决的其他问题包括node.js + async + mongoose.find,这都在async.findEach中
当我做
console.log(that.thing.toJSON)
Run Code Online (Sandbox Code Playgroud)
我明白了:
function(){return this.toObject(); }
谢谢.
javascript ×2
node.js ×2
asynchronous ×1
css ×1
css3 ×1
html ×1
html5 ×1
json ×1
mongoose ×1
require ×1