Created
July 21, 2018 03:35
-
-
Save pdougall1/aa69d90a643ec984ba9952abaf1774db 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
const myData = {}; | |
const id = '1862e2570ed941f89e1eb5ae152df2bd'; | |
let url = `http://10.0.0.133:5000/status?cli=True&id=01671c4f4fe54be0bd544e2343d7fd83`; | |
const params = `?cli=True&id=${id}` | |
$( document ).ready(() => { | |
myData.someCount = 0; | |
$('#count').text(myData.someCount); | |
$('#initial').text(window.localStorage.getItem('fuel')); | |
var cat = localStorage.getItem('fuel'); | |
console.log('cat', cat) | |
$('#my-button').on('click', () => { | |
myData.someCount = myData.someCount + 1; | |
$('#count').text(myData.someCount); | |
$('#text').text('this is new') | |
$.ajax({ url: url }).done( response => { | |
$('#data').text(response.status.fuel); | |
window.localStorage.setItem('fuel', JSON.stringify(response.status.fuel)); | |
$('#initial').text(window.localStorage.getItem('fuel')); | |
}).fail(function(error) { | |
console.log('error', error); | |
}); | |
}); | |
}); | |
const MyClass = function () {}; | |
MyClass.prototype.someMethod = function (someParam) { | |
this.someParam = someParam; | |
} | |
let myInstance = new MyClass; | |
myInstance.someMethod(param) | |
let otherInstance = new MyClass; | |
otherInstance.someMethod(param) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment