Javascript:
<script type="text/javascript">
var getValue = function (appkey, itemkey) {
$.ajax({
type: "GET",
url: "https://keyvalue.immanuel.co/api/KeyVal/GetValue/" + appkey + "/" + itemkey,
contentType: false,
processData: false
}).done(function (data) {
}).fail(function(err){
});
}
var updateValue = function (appkey, itemkey, itemval) {
$.ajax({
type: "POST",
url: "https://keyvalue.immanuel.co/api/KeyVal/UpdateValue/" + appkey + "/" + itemkey + "/" + itemval,
contentType: false,
processData: false
}).done(function (data) {
}).fail(function(err){
});
}
var actOnValue = function (appkey, itemkey, action) {
$.ajax({
type: "POST",
url: "https://keyvalue.immanuel.co/api/KeyVal/ActOnValue/" + appkey + "/" + itemkey + "/" + action,
contentType: false,
processData: false
}).done(function (data) {
}).fail(function(err){
});
}
</script>
Usage:
- getValue('appKey', 'ItekKey') //Get already stored value, else null
- updateValue('appKey', 'ItekKey', 'ItemValue') //Update stored key & value
- actOnValue('appKey', 'ItekKey', 'Increment') //action 'Increment', will +1