Guest User

Untitled

a guest
Jan 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. //DO NOT USE FRAMEWORKS
  2.  
  3. /**
  4. * 1. Below discount rule should have dynamic data
  5. * - Create a function to fill this dynamic data
  6. * - Append to a HTML element with class .container
  7. */
  8.  
  9. var discountRule = 'Add two more 2 products and receive 5 euro discount!';
  10.  
  11. /**
  12. * 2. Expand above code to have unlimited amount of dynamic arguments
  13. * - Use a regulare expression to replace the dynamic arguments
  14. * - Append to a HTML element with class .container
  15. */
  16.  
  17. var discountRule = 'Add two more 2 products, receive 5 euro discount and 10 euro shipping discount!';
  18.  
  19. /**
  20. * 3. Create a prototype public function for above function
  21. * - Use below String.prototype example
  22. * - Define function and execute function, append result to a HTML element with class .container
  23. */
  24. String.prototype.functionName = function () {}
  25.  
  26. /**
  27. * 4. Above code should be executed after every AJAX call
  28. * - Create an EventListener and apply the event listener on the correct element
  29. * - When the event is executed, execute the correct function
  30. * - Show how the event should be triggered
  31. */
  32. element.addEventListener("event", function () { /* Code */ });
Add Comment
Please, Sign In to add comment