3

我有以下签名板。

     <form method=post action="#" class=sigPad>        
               <label for=name>Print your name</label>        
               <input type=text name=name id=name class=name>        
               <p class="drawItDesc">Draw your signature</p>        
               <div class="sig sigWrapper"> <div class=typed></div>        
               <canvas class=pad width="585px" height="200px"></canvas>        
               <input type=hidden name=output class=output> </div>        
               <button type="submit" id="agree" style="opacity:0.2">I accept the terms of this agreement.</button>        
      </form>

这是需要时调用的函数。

   function drawSigPad(){
         $('.sigPad').signaturePad({drawOnly:true});
            }

当用户按下按钮时,会发生什么情况会绘制签名板。这在 Chrome 和 FF 中运行良好,但在 IE 不兼容模式下会中断。只要不打开非兼容性,它就可以工作。

我得到的错误如下。

   SCRIPT5007: Unable to get value of the property 'getContext': object is null or undefined 
          jquery.signaturepad.min.js, line 246 character 1

有问题的行是这个

    i.bind("selectstart.signaturepad",function(a){
return c(a.target).is(":input")
});

任何人都知道为什么IE7会打破这个?或者解决这个问题的方法。

编辑:对不起,我正在使用 IE9 浏览器并使用非兼容模式以及使用浏览器工具检查 IE7。

4

1 回答 1

1

IE7 不支持canvas标签。它仅在 IE8+ 中支持。

是获取画布标签和任何其他 html5 标签的绝妙方法,可在 IE7 和 8 中使用。

它被称为 explorercanvas,它模拟画布,允许几乎任何浏览器显示您的 sig pad。

最好的是,您需要做的就是添加一个<script>标签。

于 2013-01-08T18:53:12.560 回答