Php html2canvas:捕获远程网站的屏幕截图
各位 我是js的新手,这让我很难捕捉和拍摄远程网站的截图。有人能给我指出正确的方向吗 我不断地发现这个错误: 未捕获类型错误:对象[Object Object]没有方法“html2canvas”索引。php:4201 capture index.php:4201 onclick 我的代码是index.phpPhp html2canvas:捕获远程网站的屏幕截图,php,javascript,html2canvas,Php,Javascript,Html2canvas,各位 我是js的新手,这让我很难捕捉和拍摄远程网站的截图。有人能给我指出正确的方向吗 我不断地发现这个错误: 未捕获类型错误:对象[Object Object]没有方法“html2canvas”索引。php:4201 capture index.php:4201 onclick 我的代码是index.php <html> <head> <title>Hawk-Eye: Have a look at what others are upto</title&
<html>
<head>
<title>Hawk-Eye: Have a look at what others are upto</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://localhost/Hawk-eye/html2canvas.js"></script>
<script type="text/javascript" src="http://localhost/Hawk- eye/jquery.plugin.html2canvas.js"></script>
</head>
<body>
<div id="target">
<?php
$homepage= file_get_contents('http://www.yahoo.com');
echo $homepage;
?>
</div>
<form method="POST" enctype="multipart/form-data" action="save.php" id="myForm">
<input type="hidden" name="img_val" id="img_val" value="" />
</form>
<script type="text/javascript">
function capture() {
$('#target').html2canvas({
onrendered: function (canvas) {
//Set hidden field's value to image data (base-64 string)
$('#img_val').val(canvas.toDataURL("image/png"));
//Submit the form manually
document.getElementById("myForm").submit();
}
});
}
</script>
<input type="submit" value="Take Screenshot" onclick="capture();" />
</body>
</html>
鹰眼:看看别人在干什么
函数捕获(){
$(“#目标”).html2canvas({
onrendered:函数(画布){
//将隐藏字段的值设置为图像数据(base-64字符串)
$('img_val').val(canvas.toDataURL(“image/png”);
//手动提交表单
document.getElementById(“myForm”).submit();
}
});
}
下载html4canvas并将其作为
<script type="text/javascript" src="html2canvas.js?rev032"></script>
http://localhost/Hawk- eye/jquery.plugin.html2canvas.js
你确定这是正确的路径吗?dev null居住者:我认为这是路径问题。Php storm通过从正确的路径导入它来进行自动修复。我觉得自己像个傻瓜:/