Created
July 31, 2010 14:52
-
-
Save GaretJax/502257 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html dir="ltr" lang="en-US"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>jQuery Card reader</title> | |
<!-- Include the scripts --> | |
<script type="text/javascript" charset="utf-8" src="scripts/jquery.js"></script> | |
<script type="text/javascript" charset="utf-8" src="scripts/CardReader.js"></script> | |
<!-- Initialize the reader --> | |
<script type="text/javascript"> | |
jQuery(function () { | |
// Create a new reader instance | |
var reader = new CardReader(); | |
// Feed it an object to observe (this could also be a textbox) | |
reader.observe(window); | |
// Errback in case of a reading error | |
reader.cardError(function () { | |
alert("A read error occurred"); | |
}); | |
// Callback in case of a successful reading operation | |
reader.cardRead(function (value) { | |
$('form input#card_number').val(value); | |
$('from').submit(); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<form action="" method="get"> | |
<input type="hidden" name="card_content" id="card_number" /> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment