Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Nov 15th, 2018 80 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. ### Using Controllers
  2. * Use `Controllers`, which are function declarations that contain public and private methods
  3. * For example:
  4.  
  5. ```javascript
  6. var budgetController = function() {
  7.   // declare private functions here
  8.   var functionOne = function() {
  9.    
  10.   }
  11.  
  12.   // declare other variables and data structures
  13.  
  14.   // in order to return public functions, you must return them in an object!
  15.   // CLOSURES!
  16.   return {
  17.     pubFunctionOne: function() {
  18.      
  19.     },
  20.    
  21.     pubFunctionTwo: function() {
  22.      
  23.     }
  24.   }
  25.  
  26. }
  27.  
  28. ```
  29.  
  30. ---
  31. ### HTML DOM Element Creation
  32. * You can create DOM elements in a string
  33. * For content that needs interpolation or a real value, insert a placeholder: `%example%`
  34.     * To insert a value into this location: `htmlString.replace("%example%", actualValue)`
  35.     * Then re-insert this newly editted string to the DOM element!
  36.  
  37. ---
  38. ### JS DOM Element Querying
  39. * Save all queried strings into an object (in case the element needs to be re-queried)
  40.     * `var DOMElements = { btn: ".btn"}`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top