-
-
Save liondancer/01173270965841c21da0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<form id="test-form" action="/test/" method="post"> {# pass data to /test/ URL #} | |
<div class="test-button-set"> | |
<button type="button" id="hdfs-test" class="btn btn-default btn-lg selected">HDFS</button> | |
<button type="button" id="hive-test" class="btn btn-default btn-lg">HIVE</button> | |
<button type="button" id="hdfs-hive-test" class="btn btn-default btn-lg">BOTH</button> | |
</div> | |
<button id="submit-test" type="submit" class="btn btn-default btn-lg">Submit</button> | |
</form> |
This file contains hidden or 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
/** | |
* Created by bli1 on 12/18/14. | |
*/ | |
$(document).ready(function() { | |
// Data to describe what kind of test | |
var testData = { | |
"timestamp": "", | |
"hive": 0, | |
"hdfs": 0, | |
// Contains a list of testData objects | |
"beacons":[] | |
}; | |
var testRun = document.getElementById("test-form"); | |
testRun.addEventListener('submit', function() { | |
testData["timestamp"] = new Date().getTime(); | |
$.post("/test/", testData); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment