rbrisita / fakefoursquare Goto Github PK
View Code? Open in Web Editor NEWExample geolocation web application using the Python, MongoDB, and JQuery with Bootstrap.
Home Page: https://fakefoursquare.herokuapp.com
License: MIT License
Example geolocation web application using the Python, MongoDB, and JQuery with Bootstrap.
Home Page: https://fakefoursquare.herokuapp.com
License: MIT License
fakeFourSquare/app/static/js/app.js
Line 68 in ec0e41d
So its just best practice to not do this. It's perfectly fine if you're the only person working on the app and you have complete control, but in general it's a bad habit.
So what are your thoughts on using ES6 and hooking up Webpack/Babel? ES6 will allow you to give your code a little more structure with breaking it out into smaller chunks and importing what you need.
fakeFourSquare/app/static/js/app.js
Line 5 in ec0e41d
By far, my favorite feature of ES6 is template literals. It allows you to easily manage your templates and you don't have to do a replace
method to append your data.
EX:
const dataSource = {
name: "Bobby Window",
occupation: "Ladies Man",
age: "None of your business!"
}
const {name, occupation, age} = dataSource;
const example_tpl = `
<div>
<span>${name}</span>
<span>${occupation}</span>
<span>${age}</span>
</div>
`
fakeFourSquare/app/static/js/app.js
Line 139 in ec0e41d
I haven't used jQuery in a while, but I recall there being a .then()
method which automatically resolves a promise
$.get('some_uri_.json').then((data) => {
// response logic goes here
return somedata;
}).done((data) => {
// your data is ready to be binded to the DOM and the promise has been resolved.
})
NOTE: Syntax might be a little off, but that's the basic concept
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.