We Code Daily

SETUP index.html So what did we do here? We linked the Ajax Google Api CDN(jQuery), then we linked our jQuery script file, which we will be editing and programming in, instead of downloading jQuery. script.js

Linking Files HTML:(make a file and write this code and then save it as "index" make sure the extension is '.html') Script(jQuery):(make a file and write this code and then save it as "script" make sure the extension is '.js') Now, we have our files ready and all what we have to do is to … Continue reading jQuery: Linking Our Files

Definition jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. All what you need to know is that it is a JavaScript library and that it is fast and … Continue reading jQuery: What is it? What will we do?

Definition 'Arrays': Can store a group of values, like a group of strings or numbers. Example var names = ["Jack", "Josh", "John"]; or var names = new Array("Jack", "Josh", "John"); Now, how can I retrieve or access the array to get the name Josh and change it? names[1] = "Johnny"; Remember in JS, and in … Continue reading JavaScript: Arrays

Definition Imagine you have a car(object) and you want to describe it by saying its color, motor, etc... This car is the object and the color, motor,etc.. are the properties. Example var person = { firstName:"John", lastName:"Doe", age:50 }; We used the keyword 'var' like when we use it for variables but instead we have braces … Continue reading JavaScript: Objects

Definition Functions / Methods are a set of statements that performs a task and if you want to use it you will have to call it somewhere in scope. For example, imagine you have a dog and you want the dog to bark, so you would make a function called bark, and when you call the … Continue reading JavaScript: Functions AKA Methods

Definition The 'do - while loop': It can shorten the code you have to write. It can carry out long tasks. Syntax do { code block to be executed } while (condition); Example var text = ""; var i = 0; do { text += "The number is " + i; i++; } while (i < 5); … Continue reading JavaScript: Do-While Loop

Definition The 'while loop': It can shorten the code you have to write. It can handle long tasks. Syntax // While Loop while(condition) { } Example // While Loop while(x <= 21) { console.log(x); x++; } Checks if var x is smaller or equal to 21 and then logs it to the console, after that it … Continue reading JavaScript: While Loop

Definition The 'for loop': it can shorten the code you have to write. it can handle long tasks. NOTE #1 : The for loop syntax is almost the same in all programming languages. Example (Not using the 'for loop') console.log("10"); console.log("20"); console.log("30"); console.log("40"); console.log("50"); console.log("60"); console.log("70"); console.log("80"); console.log("90"); console.log("100"); Here is the second example:(using the 'for loop') … Continue reading JavaScript: For Loop