aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarak Squires <[email protected]>2010-05-16 02:52:11 -0400
committerMarak Squires <[email protected]>2010-05-16 02:52:11 -0400
commitf33ea9b0b196e4e0753101f479381fcd360c7807 (patch)
tree0ad8485dd2bbacd3d4b8b9f0fae64d42836f69b3
parent9f99823a90286ec47323d2b46f814a2f911719af (diff)
downloadfaker-f33ea9b0b196e4e0753101f479381fcd360c7807.tar.xz
faker-f33ea9b0b196e4e0753101f479381fcd360c7807.zip
basic demo now works
-rw-r--r--demo.html21
1 files changed, 19 insertions, 2 deletions
diff --git a/demo.html b/demo.html
index 437b8ace..67554a50 100644
--- a/demo.html
+++ b/demo.html
@@ -33,19 +33,36 @@
}
$(document).ready(function(e){
+
var card = Faker.Helpers.createCard();
$('#output').html(prettyPrint(card));
+
$('#generate').click(function(){
var card = Faker.Helpers.createCard();
$('#output').html(prettyPrint(card));
});
+
+ $('#generateSet').click(function(){
+
+ setTimeout(function(){
+ var cards = [];
+ for(var i = 0; i < $('#cardCount').val(); i++){
+ var card = Faker.Helpers.createCard();
+ cards.push(card);
+ }
+ $('#output').html('<textarea cols = "100" rows = "100">'+JSON.stringify(cards)+'</textarea>');
+ }, 10);
+
+ });
+
});
</script>
</head>
<body>
- <input id = "generate" type = "button" value = "Generate Random Card" />
- <input id = "generateSet" type = "button" value = "Generate an assosative JSON set of Random Card" />
+ <input id = "generate" type = "button" value = "generate one random card as HTML" />
+ <input id = "generateSet" type = "button" value = "generate an assosative array of random cards as JSON" />
+ card count : <input id = "cardCount" type = "text" size = "3" value = "5" /><br/><br/>
<div id = "output"></div>
</body>
</html>