在本文中,我们将为您详细介绍未捕获的EvalError:拒绝将字符串评估为JavaScript,因为'unsafe-eval'不是允许的源...在vue-pdf中的相关知识,此外,我们还会提供一些关于
在本文中,我们将为您详细介绍未捕获的 EvalError:拒绝将字符串评估为 JavaScript,因为 'unsafe-eval' 不是允许的源...在 vue-pdf 中的相关知识,此外,我们还会提供一些关于Angular App中的ExcelJS:“未捕获的EvalError:'unsafe-eval'不是以下内容中允许的脚本源”、Javascript / jQuery |未捕获的SyntaxError:意外的输入结束?、javascript – jQuery:未捕获TypeError:$(…).click不是函数、javascript – JSON.stringify中未捕获的InvalidStateError的有用信息。
本文目录一览:- 未捕获的 EvalError:拒绝将字符串评估为 JavaScript,因为 'unsafe-eval' 不是允许的源...在 vue-pdf 中
- Angular App中的ExcelJS:“未捕获的EvalError:'unsafe-eval'不是以下内容中允许的脚本源”
- Javascript / jQuery |未捕获的SyntaxError:意外的输入结束?
- javascript – jQuery:未捕获TypeError:$(…).click不是函数
- javascript – JSON.stringify中未捕获的InvalidStateError
未捕获的 EvalError:拒绝将字符串评估为 JavaScript,因为 'unsafe-eval' 不是允许的源...在 vue-pdf 中
如何解决未捕获的 EvalError:拒绝将字符串评估为 JavaScript,因为 ''unsafe-eval'' 不是允许的源...在 vue-pdf 中?
我使用 vue-pdf 作为 pdf-viewer。 但我遇到了这个错误。
这是我的代码
<template>
...
<pdf :src="pdfUrl" />
...
</template>
<script>
...
import pdf from ''vue-pdf''
export default {
...
components: {
...,pdf
}
data() {
return ({
pdfUrl: "...",....
})
}
}
</script>
这是错误图片
请帮帮我。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
Angular App中的ExcelJS:“未捕获的EvalError:'unsafe-eval'不是以下内容中允许的脚本源”
如何解决Angular App中的ExcelJS:“未捕获的EvalError:''unsafe-eval''不是以下内容中允许的脚本源”?
我已经在IIS服务器上部署了使用ExcelJS库的Angular Application。我当前的安全策略迫使我在IIS Http Response中的标头下面返回
content-security-policy:script-src''self''; img-src''self''
使用此设置,Angular应用程序将不会加载并出现以下错误。
exceljs.js:87162未捕获的EvalError:拒绝将字符串评估为JavaScript,因为在以下内容安全策略指令“ script-src''self''”中不允许使用''unsafe-eval''。>
是否有任何方法可以覆盖Http Response安全策略。我尝试使用添加内容安全策略 但这没用。
有人可以建议如何使用严格的内容安全策略运行ExcelJS吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
Javascript / jQuery |未捕获的SyntaxError:意外的输入结束?
<script> $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top },1000); return false; } } }); </script>
解决方法
如果您将代码复制到jsbeautifier.org,请单击“Beautify”并查看是否所有缩进都正确.
javascript – jQuery:未捕获TypeError:$(…).click不是函数
不知道我在哪里错了 – 我正试图在点击另一个时隐藏某个div.这是我的jQuery(放在.html文件的最底部):
<script>
$(document).ready(function() {
$(".card__container--closed").click(function () {
$(".hide__overlay").hide();
});
});
</script>
<div>
<p>NEWS</p>
</div>
<div id="card">
...some SVG image thing here...
</div>
但是,由于某种原因,我收到以下错误:
Uncaught TypeError: $(...).click is not a function
at HTMLDocument.<anonymous>
我正在使用jQuery 3.2.1 …
解决方法:
你所有的问题都是因为你使用的是jQuery 3,并且自jQuery 2以来已经删除了很多东西.请记住,主要的版本号意味着他们可以包含重大更改.有关jQuery 3.0中的不同之处,请阅读jQuery 3.0 Upgrade Guide.
首先,您不需要$(document).ready().很久以前就被简化为:
$(function() {
// your code
});
在较新版本的jQuery中,click()等快捷方式事件已被弃用,因为它们是多余的.在最新版本中,它们已被完全删除.
相反,您需要使用.on()
来设置所有事件侦听器.
$(".card__container--closed").on('click', function() {
// ...
});
更新:你在评论中提到你从.hide()方法获得了相同的TypeErrors.这是因为它在jQuery 3中被删除了,因为它通常不能很好地与人们的样式表一起使用.相反,您可以使用addClass(),removeClass()和toggleClass()将您自己的show / hide类添加到元素中.然后,您可以在样式表中设置这些类的样式,以便您可以完全控制如何实现显示和隐藏.
再次,请阅读jQuery 3.0 Upgrade Guide,因为您的所有问题都基于jQuery 3不再具有的过时方法.
javascript – JSON.stringify中未捕获的InvalidStateError
我已经阅读了这个其他帖子,这并不好:Put data into JSON with Jquery
每当我尝试JSON.stringify一个对象数组时,我得到一个错误说:
Uncaught InvalidStateError: An attempt was made to use an object that is not, or is no longer, usable.
这是我的JS:
var responseItems = [];
var keynoteContainer = $('div.keynote-questions');
var eventQuestionContainer = $('div.event-questions');
var sessionContainer = $('div.session-questions');
var eventId = $('#Evaluation-event-id').val();
keynoteContainer.children().each(function (index, el) {
var element = $(el);
var id = "-1";
var parentId = element.find('input[type=hidden]').val();
var parentType = "Keynote";
var responseValue = element.find('.response-item-slider').slider("option", "value");
var responseText = "";
var response = { "Id": id, "EventId": eventId, "ParentId": parentId, "ParentType": parentType, "ResponseValue": responseValue, "ResponseText": responseText };
responseItems.push(response);
});
eventQuestionContainer.children().each(function (index, el) {
var element = $(el);
var id = "-1";
var parentId = element.find('input[type=hidden]').val();
var parentType = "EventQuestion";
var responseValue = element.find('.response-item-slider').slider("option", "value");
var responseText = element.find('textarea').val();
var response = { "Id": id, "EventId": eventId, "ParentId": parentId, "ParentType": parentType, "ResponseValue": responseValue, "ResponseText": responseText };
responseItems.push(response);
});
sessionContainer.children().each(function (index, el) {
var element = $(el);
var id = "-1";
var parentId = element.find('input[type=hidden]').val();
var parentType = "Session";
var responseValue = element.find('.response-item-slider').slider("option", "value");
var responseText = "";
var response = { "Id": id, "EventId": eventId, "ParentId": parentId, "ParentType": parentType, "ResponseValue": responseValue, "ResponseText": responseText };
responseItems.push(response);
});
responseItems = JSON.stringify(responseItems);
我已经尝试记录所有内容,它只会在我对其进行字符串化的最后一行中断.
我怎样才能解决这个问题?任何建议或信息都将受到高度赞赏.
解决方法:
我有同样的错误.就我而言,当我设置其中一个模型属性时,我忘记了.val().在我尝试JSON.stringify模型之前没有错误
this.model.set(
{
customername: this.$("#customername").val(),
jobtitle: this.$("#jobtitle"), //This was the line causing the error
testimonialtext: this.$("#testimonialtext").val()
});
关于未捕获的 EvalError:拒绝将字符串评估为 JavaScript,因为 'unsafe-eval' 不是允许的源...在 vue-pdf 中的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Angular App中的ExcelJS:“未捕获的EvalError:'unsafe-eval'不是以下内容中允许的脚本源”、Javascript / jQuery |未捕获的SyntaxError:意外的输入结束?、javascript – jQuery:未捕获TypeError:$(…).click不是函数、javascript – JSON.stringify中未捕获的InvalidStateError等相关内容,可以在本站寻找。
本文标签: