Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //DO NOT USE FRAMEWORKS
- /**
- * 1. Below discount rule should have dynamic data
- * - Create a function to fill this dynamic data
- * - Append to a HTML element with class .container
- */
- var discountRule = 'Add two more 2 products and receive 5 euro discount!';
- /**
- * 2. Expand above code to have unlimited amount of dynamic arguments
- * - Use a regulare expression to replace the dynamic arguments
- * - Append to a HTML element with class .container
- */
- var discountRule = 'Add two more 2 products, receive 5 euro discount and 10 euro shipping discount!';
- /**
- * 3. Create a prototype public function for above function
- * - Use below String.prototype example
- * - Define function and execute function, append result to a HTML element with class .container
- */
- String.prototype.functionName = function () {}
- /**
- * 4. Above code should be executed after every AJAX call
- * - Create an EventListener and apply the event listener on the correct element
- * - When the event is executed, execute the correct function
- * - Show how the event should be triggered
- */
- element.addEventListener("event", function () { /* Code */ });
Add Comment
Please, Sign In to add comment