brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
696 stars 529 forks source link

TypeError: Cannot call method 'resetCanvas' of undefined #59

Closed csperle closed 8 years ago

csperle commented 10 years ago

Hi

we use jSignature on iOS and on Android. But while everything works on iOS, the same code produces the following exception (from time to time) on Android:

TypeError: Cannot call method 'resetCanvas' of undefined
at _clearDrawingArea (jSignature.js:1304:45)
at $.fn.(anonymous function) (jSignature.js:1448:40:45)

Any help is welcome.

Regards Christoph

brinley commented 10 years ago

It depends on how you are caling it... it would look to me like the its unable to find the reference to the jSignature instance.

csperle commented 10 years ago

Hi

we solved this problem in the meanwhile with a workaround: When we wanted to delete the signature, we called:

this.jSignature("setData", JSON.parse(""), "native");

this call did raise the exception on Android devices (but worked everywhere else). After we changed it to:

this.jSignature("setData", JSON.parse("[]"), "native");

The problem disapeared. Issue can be closed.

Regards Christoph