小编Erf*_*oor的帖子

如何修复getImageData()错误画布受到跨源数据的污染?

我的代码在我的localhost上运行得很好,但是它在网站上没有运行.

我从控制台得到了这个错误.getImageData(x,y,1,1).data:

Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data. 
Run Code Online (Sandbox Code Playgroud)

我的部分代码:

jQuery.Event.prototype.rgb=function(){
        var x =  this.offsetX || (this.pageX - $(this.target).offset().left),y =  this.offsetY || (this.pageY - $(this.target).offset().top);
        if (this.target.nodeName!=="CANVAS")return null;
        return this.target.getContext('2d').getImageData(x,y,1,1).data;
    }
Run Code Online (Sandbox Code Playgroud)

注意:我的图片网址(src)来自子网址网址

javascript html5 html5-canvas

117
推荐指数
7
解决办法
13万
查看次数

如何向JqueryTe添加新按钮(texteditor插件)

如何向JqueryTe编辑器插件添加自定义按钮:

add button: <center>string</center>
add button: add image url <img src="string" />
Run Code Online (Sandbox Code Playgroud)

code.google.com/

jqueryte.com

jquery textarea

5
推荐指数
1
解决办法
1436
查看次数

错误禁止WampServer

我在Windows 8中使用了64位的wamp; 安装后我的图标是橙色但是,我点击表单服务apache>安装服务\和Apache正常运行(将颜色更改为绿色)

但在localhost/浏览器中打开后,显示此错误:

Forbidden 

You don't have permission to access / on this server. enter code here
Run Code Online (Sandbox Code Playgroud)

但是从127.0.0.1开始运行非常好 (from localhost not working)

我的窗户是 microsoft windows 8

wampserver

5
推荐指数
2
解决办法
2万
查看次数

标签 统计

html5 ×1

html5-canvas ×1

javascript ×1

jquery ×1

textarea ×1

wampserver ×1