Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/366.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 类型“JQuery上不存在属性“printThis”_Javascript_Jquery_Angular_Typescript - Fatal编程技术网

Javascript 类型“JQuery上不存在属性“printThis”

Javascript 类型“JQuery上不存在属性“printThis”,javascript,jquery,angular,typescript,Javascript,Jquery,Angular,Typescript,我想使用jQuery的属性printThis在angular中打印我的视图 但它给了我这个错误 类型“JQuery”上不存在属性“printThis” 对于类,使用下面的代码 $(".demo").printThis(); $('#demo-one, #demo-two, #demo-three').printThis({ importCSS: false, // option header: "<h1>Look at all of my Demo's!</h1>

我想使用jQuery的属性printThis在angular中打印我的视图 但它给了我这个错误

类型“JQuery”上不存在属性“printThis”


对于类,使用下面的代码

$(".demo").printThis();
$('#demo-one, #demo-two, #demo-three').printThis({
  importCSS: false, // option
  header: "<h1>Look at all of my Demo's!</h1>" //option
});
对于Id,请使用以下代码

$(".demo").printThis();
$('#demo-one, #demo-two, #demo-three').printThis({
  importCSS: false, // option
  header: "<h1>Look at all of my Demo's!</h1>" //option
});

了解更多信息。访问

在没有相关代码片段的情况下提问不是一个好做法。您需要包含不起作用的代码。请阅读,然后编辑您的问题并加以改进。您可以分享您是如何导入jqery并将其打印到代码中的吗?我使用了类1。现在它消除了错误,但它带来了另一个错误。当我现在点击按钮时,它会显示错误类型错误:$..打印这不是一个函数使用它的选项。它可能会解决问题。或者提供您的代码,使我们更容易理解问题的实际所在@user10762713print{$.modal1.printThis;}这是我的方法,如果您喜欢,请使用Id$anyId.clickfunction{$modalId.printThis{debug:true};};你可以这样做。更多信息。请访问此链接: