简体   繁体   English

jSignature-生成的值将不呈现

[英]jSignature - generated value won't render

I'm using the latest jSignature ( https://github.com/brinley/jSignature ), generating base30 signatures and saving them in a mysql database. 我正在使用最新的jSignature( https://github.com/brinley/jSignature ),生成base30签名并将其保存在mysql数据库中。 This usually works great; 这通常效果很好; on this occasion, though, the user input a signature, it saved, but the signature won't render. 在这种情况下,尽管用户输入了签名,但签名已保存,但签名不会呈现。 Instead, a very non-descript javascript error appears in the dev tools. 而是在开发工具中出现了一个非常无法描述的javascript错误。 I have a jsfiddle of it up here: 我在这里有一个jsfiddle:

https://jsfiddle.net/evilpluto/onh3z3k0/ https://jsfiddle.net/evilpluto/onh3z3k0/

To activate it, I just pull from a hidden form field like so 要激活它,我只需要像这样从隐藏的表单字段中拉出

$(".signature_form").height("170px").jSignature("reset").jSignature("importData", 'data:'+ $(".hiddenSigDataForm").val());

It just seems like the base30 that was generated is corrupt in some way, but I'm not sure why it would generate the javascript error. 看起来好像生成的base30在某种程度上已损坏,但是我不确定为什么会生成javascript错误。 In the jfiddle I put a working button (loads fine) and then the base30 string that errors as the "non-working" button. 在jfiddle中,我放置了一个工作按钮(加载正常),然后放置了错误为“ non-working”按钮的base30字符串。

Any ideas? 有任何想法吗?

Uh, oops. 呃,糟糕 The problem was not that jsignature magically couldn't render anymore. 问题不是jsignature神奇地无法渲染。 The problem was I stored the value in a varchar(255), and the base30 value was truncated to the point that it was unusable. 问题是我将值存储在varchar(255)中,并且base30值被截断到无法使用的地步。 My others worked because they were smaller. 我的其他人之所以工作是因为它们较小。

Then I figured out that mysql now allows > 255 in varchars...this has been a very educational night. 然后我发现mysql现在允许varchars> 255 ...这是一个非常有教育意义的夜晚。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM