gpt4 book ai didi

javascript - 方法未捕获安全错误: Blocked a frame with origin

转载 作者:行者123 更新时间:2023-12-03 10:44:26 24 4
gpt4 key购买 nike

该方法似乎有问题。当安装“不安全”时,该方法内的代码工作得很好。谢谢!

未捕获的安全错误:阻止来源为“http://localhost:3000”的框架访问来源为“chrome-extension://oknpjjbmpnndlpmnhmekjpocelpnlfdi”的框架。请求访问的帧具有“http”协议(protocol),被访问的帧具有“chrome-extension”协议(protocol)。协议(protocol)必须匹配。

模板事件

Template.docEdit.events({
'click .remove': function(event, template) {
var thisTag = String(this);
Meteor.call('removeTag', template, thisTag);
},
});

方法

Meteor.methods({
removeTag: function(template, thisTag) {
MyPix.update (
template.data._id,
{ $pull: { 'metadata.tags': thisTag }}
);
}
})

这确实适用于添加“不安全”

Template.docEdit.events({
'click .remove': function(event, template) {
var thisTag = String(this);
MyPix.update (
template.data._id,
{ $pull: { 'metadata.tags': thisTag }}
);
}
});

最佳答案

好的,我传递了整个模板。该方法只需要 id。

模板事件

Template.docEdit.events({
'click .remove': function(event, template) {
var thisTag = String(this);
var thisId = template.data._id; // assign id to var
Meteor.call('removeTag', thisId, thisTag);
},
});

方法

Meteor.methods({
removeTag: function(thisId, thisTag) {
MyPix.update (
thisId,
{ $pull: { 'metadata.tags': thisTag }}
);
},
})

关于javascript - 方法未捕获安全错误: Blocked a frame with origin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28625564/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com