Note that there are some explanatory texts on larger screens.

plurals
  1. POOpera error : Uncaught exception: TypeError: Cannot convert 'xxxxxx' to object
    primarykey
    data
    text
    <p>i come today to show an error thrown by opera in Jquery ,about object transformation , here is the code ( function setColor(x,y) ):</p> <pre><code>colourpixel = $('#colour').css('background-color').match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);//["rgb(0, 70, 255", "0", "70", "255"] var canvas = document.createElement('canvas'); canvas.height=190; canvas.width=190; canvascontext = canvas.getContext("2d"); defaultdata = $('#light').get(0).getContext("2d").getImageData(0,0,190,190); canvascontext.putImageData(defaultdata,0,0); canvascontext.globalCompositeOperation = 'destination-atop'; canvascontext.fillStyle='rgb( '+colourpixel[1]+', '+colourpixel[2]+', '+colourpixel[3]+')'; </code></pre> <p>And here is the error thrown by opera :</p> <pre><code>Uncaught exception: TypeError: Cannot convert 'colourpixel' to object Error thrown at line 157, column 1 in setColor(x, y) in file://localhost/home/angelus/Desarrollo/webs/ColorP/functions.js: canvascontext.fillStyle='rgb( '+colourpixel[1]+', '+colourpixel[2]+', '+colourpixel[3]+')'; called from line 61, column 2 in &lt;anonymous function&gt;(event) in file://localhost/home/angelus/Desarrollo/webs/ColorP/functions.js: setColor(x,y); called from line 55, column 294 in &lt;anonymous function: handle&gt;(a) in file://localhost/home/angelus/Desarrollo/webs/ColorP/jquery.min.js: i=i.handler.apply(this,arguments); called via Function.prototype.apply() from line 49, column 569 in &lt;anonymous function: o&gt;() in file://localhost/home/angelus/Desarrollo/webs/ColorP/jquery.min.js: return typeof c!=="undefined"&amp;&amp;!c.event.triggered?c.event.handle.apply(o.elem,arguments):w </code></pre> <p>I have tried to create the object like an array ( var colourpixel = new Array(); ) but nothing run. </p> <p>Thank you in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload