jquery - 签名板在 IE7 中不工作

标签 jquery html internet-explorer digital-signature

我有以下签名板。

     <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。

最佳答案

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

here是获取在 IE7 和 8 中工作的 Canvas 标签和任何其他 html5 标签的好方法。

它称为 explorercanvas,它模拟 Canvas ,几乎允许任何浏览器显示您的签名板。

最棒的是,您只需添加一个 <script>标签。

关于jquery - 签名板在 IE7 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12935872/

相关文章:

internet-explorer - 方法调用失败,因为 [System.Object[]] 不包含名为 'Click' 的方法

javascript - jQuery find() 适用于 IE,但不适用于 Chrome 或 Firefox

Javascript:显示选定的图像

html - 旋转具有变换原点的对象在 Firefox 中不起作用

html - 出现在文本段落中时 DIV 上方的空间(工具提示)

html - Mobile Table 崩溃 IE9

jquery - 在 ASP.NET MVC4 项目中包含 jquery 的正确方法

javascript - 动画显示和隐藏随机化

javascript - POST HTML图像对象作为文件

javascript - document.title 问题 ie8