Coder Social home page Coder Social logo

learningrepo's Introduction

LearningRepo

learningrepo's People

Watchers

James Cloos avatar

learningrepo's Issues

JS Cleanup

  1. In ajax call you're making to read the JSON file, optimize the code within each loop. Variables that are constant for each iteration of the loop should be defined outside the loop. Also, your JSON file should contain properly formatted data so that onSuccess function only iterates over it and applies the data to the template.

  2. Try avoiding string concatenation. See how it's done in JS code. So, instead of doing string1 + ',' + string2, you should format the string by using some sort of placeholders, for example, '{string 1},{string2}', without using the + operator.

  3. Centralize all the hard-coded data into a single file (settings-like). For instance, you have splitPos, which should be more global.

  4. DRY the communication between your code and the Google Maps API into a single function, creating a sort of tier that communicates with API. Your code should call that tier and expect a response.

  5. Execute JS (jQuery) as a response to a certain event that's triggered on the UI. It might help you to ask yourself a question ('When should this be executed?').

Script reference

Can you explain why you had to do this
<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDI3FxNgeGztxxvOHL4xbzNaAkOc56kYkI&callback=initMap"></script>?

Why async, defer? Also, hard coding your API key is very very bad. It should be private and available only to you. This has to be placed in a private settings file that will be loaded.

.DS_Store

.DS_Store is in your image folder. Is it in any way related to your project?

CSS cleanup

  1. Use classes instead of IDs to apply styles. This will allow you to DRY style definitions.
  2. Only one style definition should be present in a line. So, for example, width and height shouldn't be defined in the same line.
  3. Use px or em, not both. px are more favorable.
  4. Be consistent when indenting style definitions.
  5. Sort CSS styles in a concentric order (edX guideline). See https://github.com/brandon-rhodes/Concentric-CSS/blob/master/style.css

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.