Would you be so kind as to provide a means that would enable me to override a function in the MFRC522.js module.
I've tried a method, and several variants, I have used before inside the DOM, but realize this environment is not Html development. [1]
ex:
var orig_MFRC522req = MFRC522.prototype.req;
MFRC522.prototype.req = function(){
orig_MFRC522req();
print("inside override and err is: " + err);
};
My attempts produce the following error:
Uncaught Error: Field or method "prototype" does not already exist, and can't create it on undefined
at line 1 col 30
var orig_MFRC522req = MFRC522.prototype.req;
My hope is that I may garner additional detail that will assist in verifying this board and connectivity.
Robin
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
cont:
Gordon,
Would you be so kind as to provide a means that would enable me to override a function in the MFRC522.js module.
I've tried a method, and several variants, I have used before inside the DOM, but realize this environment is not Html development. [1]
ex:
My attempts produce the following error:
My hope is that I may garner additional detail that will assist in verifying this board and connectivity.
Robin
[1] http://stackoverflow.com/questions/4814550/how-to-override-a-function-in-another-javascript-file
[2] http://www.ericfeminella.com/blog/2011/11/19/function-overwriting-in-javascript/