javascript - toDataURL throws dom exception 18 only from button click -


im building mobile web/native app using knockout , phonegap. have js code:

    self.endcanvas=function(id){     var canvas;     var data;     switch(id){      case 1:              canvas=$("#canvas1")[0];             data=canvas.todataurl("image/png");             console.log(data);     } }; 

and html

    <canvas id="canvas1" width=300 height=250  data-bind="context: triggerredraw, contextcallback:redrawcanvas"></canvas>     <a  class="whitebutton" data-bind="click: endcanvas.bind($data,1)">המשך</a> 

apperantly, todataurl() function works fine when written outside self.endcanvas function, throws security error when called button click above code. knows why?


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -