Using a magnetic card reader with jQuery
Posted on , filed under Web applications
Lately I was playing with a magnetic stripe card reader in order to develop an application to manage the members registration and identification for our university students union.
I tried to differentiate the input source of the reader from the keyboard using some low-level USB library, but then found out that the device – which has a simple HID interface – was already taken over by the kernel and the only way to avoid it was (as far as I know) to write a kernel extension.
Not having enough knowledge to write an extension of this type, I rapidly abandoned the idea to write the application in Python, Java or similar and got down the Web-Application road. In this article I’ll try to illustrate and explain the code I thrown together to use the device with the jQuery javascript library.