Home
Videos uploaded by user “dcode”
Custom Events in Javascript (CustomEvent)
 
05:55
Through the use of the CustomEvent constructor, we can make our own custom events in Javascript. First we add an event listener onto an element, giving it the name of our custom event and also providing it with a callback function as per usual. When dispatching the event, we pass in some custom data for the event handler/callback function to use. In this video I look at how you can change text content and the color of the text through a custom-made event. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 2345 dcode
Arduino Tutorial - Outputting JSON over Serial
 
03:34
Outputting JSON with the Arduino is useful when you are communicating with 3rd party applications that require data formatted as a JSON string. This is particularly relevant when working on IoT projects and gathering sensor information. Full credit goes to Benoit Blanchon for creating the amazing library used in this tutorial: https://github.com/bblanchon/ArduinoJson If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 6036 dcode
Rust Programming Tutorial #1 - Hello World | Getting Started with Rust
 
01:40
In this video I'll be showing you how to make a simple "Hello World!" application using the Rust Programming Language. We do this by first declaring a 'main' function and then using the 'println!' macro to print a string to the console window. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 9283 dcode
Learn XML HTTP Requests in JavaScript | AJAX Tutorial
 
10:09
XML Http Requests (AJAX) allows you to send and receive data from external files within your Javascript code without refreshing the page or re-running your script. In this video we look at how to create a request and then download the data, inserting it into the HTML body. For your reference: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest Follow me on Twitter @dcode If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 5699 dcode
Javascript Tutorial - Custom File Upload Button | HTML + CSS
 
08:32
Regular Expression: /[\/\\]([\w\d\s\.\-\(\)]+)$/ This code is now downloadable! https://codepen.io/dcode-software/pen/RerBgR In this video I take you through how to create your own custom file upload buttons using only HTML, CSS and Javascript, no frameworks required! We can do this by 'virtually' clicking on a hidden default file upload button and then extract the value of the real file upload button and plant it into a custom-defined span tag. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 10828 dcode
Document.createElement() - Javascript DOM
 
03:46
You can create new HTML elements in your websites or web applications using the document.createElement method. This method takes one parameter, the 'tag name' (meaning the type of element to create) such as a DIV, P, INPUT or anything you like. Today we look at how we can create an element and also how we can add it to the actual webpage. For your reference (cheers Mozilla!): https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1820 dcode
Rust Programming Tutorial #28 - Defining Traits
 
04:55
Similar to interfaces in other languages, traits allow you to set 'rules' or 'requirements' for a particular struct in order for it to be considered to be 'something'. In this video we create a trait called 'HasVoiceBox' which says that any Struct implementing this trait must have a speak() and can_speak() method defined on it. For more information refer to the Rust documentation: https://doc.rust-lang.org/1.8.0/book/traits.html If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1598 dcode
How to install Laravel 5.5 on Ubuntu Server 14.04 LTS + 16.04 LTS
 
07:35
This video goes through the installation of Laravel 5.5 on Ubuntu Server 14.04 LTS + 16.04 LTS. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 2817 dcode
Rust Programming Tutorial #17 - Structs
 
03:15
In this video I take you through how you can create and use your own structs in Rust. Structs allow you to group similar pieces of information together to make a new simple data type you can then use later on. It can make your code much cleaner and easier to read. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1540 dcode
Sending POST data with AJAX in JavaScript
 
06:33
It's really easy to make a POST request through AJAX using JavaScript and then attach some data to send with that. This technique can be used to communicate with your server without refreshing the page and even feed it some useful information. In this video I take you through a simple example of how this works by first setting up the request in JavaScript and then coding a simple PHP script which will do a basic manipulation of the POST variables. From there, we display the server response to the browser. For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/send Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 6431 dcode
Bind Explained in JavaScript
 
07:05
In JavaScript, the 'bind' method allows you to attach an object to a function and then reference the attached (binded) object using the 'this' keyword. It allows you to make functions that'll work across many objects with ease. In this video I go over a simple example of how you can use 'bind', which shows you exactly how it works - it really isn't that difficult once you get the hang of it! You'll also find it very useful For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1364 dcode
Pug (Jade) Tutorial #1 - Getting Started | HTML + NodeJS
 
04:37
Pug (formally known as Jade) is a HTML preprocessor implemented in Node.js. It allows you to render HTML with powerful features such as loops, templates, mixins and native JavaScript logic + support. In this video I take you through the directory structure I'll be using for my future tutorials in this series - you'll learn how to operate the Pug CLI (Command Line Interface) to render some basic HTML. For your reference, check this out: https://pugjs.org/api/getting-started.html Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 5194 dcode
Rust Programming Tutorial #10 - Enum Types
 
03:17
Reference and documentation for Rust: https://doc.rust-lang.org/book/second-edition/ch06-01-defining-an-enum.html Refer to the above to find out how you can store data in variations. Today we look at Enum Types in Rust - Enums provide a way to express your code in a descriptive and simple way. For example, when dealing with directions of a player in a game you might want to store all their possible directions in an Enum, having the variants Up, Down, Left and Right. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 2059 dcode
Array 'find' method in Javascript (Array.prototype.find)
 
02:55
The find() method in Javascript is used on arrays to find the first element in the array that meets a condition which you pass in through a function. In this video, we look at how we can retrieve an object from an Array based on it's property value of 'occupation'. For your reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1285 dcode
Rust Programming Tutorial #23 - Implementing Traits
 
03:13
Similar to interfaces in other languages, traits in Rust allow you to define methods that should be on a struct - in this video we look at implementing the ToString trait on a custom-made object to create a to_string() method. Pretty sick. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1349 dcode
Create your own Page Pre-Loader (HTML, CSS & JS) (No-jQuery Needed)
 
09:50
Page Loaders like this are a common trend nowadays on websites, especially commercial ones. In this video we look at how to make a custom one from scratch - it's actually quite simple which you'll see as I guide you through it. It's as simple as creating a wrapper, setting an animation and then triggering the animation with Javascript once the page finishes loading. The best part? It's pure HTML, CSS & Javascript. No jQuery or external libraries are required to achieve this effect. Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 3184 dcode
Storing objects with Local Storage in JavaScript
 
06:58
The limitations of using Local Storage in JavaScript is that you are only able to store data as Strings. In this video, I take you through how to work around this and make it possible to store complex objects with Local Storage. We can achieve this by serializing (JSON.stringify) the object to store it, and then de-serializing (JSON.parse) it to access it again. Check this out: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1652 dcode
Array 'findIndex' method in Javascript (Array.prototype.findIndex)
 
02:47
You can use the findIndex() method on Arrays in Javascript to search through an array and find the index of an element which meets/satisfies a testing condition that you pass in through a function. For your reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 846 dcode
getBoundingClientRect() in Javascript DOM
 
09:19
The Element.getBoundingClientRect method will return you an object containing properties about the surrounding rectangle of an Element. These are all relative to the top-left corner of the viewport (or browser window). This also takes the border-box into account, meaning any borders or padding is included within the returned properties. It's very useful for building user interfaces and in this video we look at an example of how we can actually get this data and also a simple demo of it being used where once a DIV comes into view, its background color is changed to red. Check this out: https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1150 dcode
Rust Programming Tutorial #30 - Reading User Input
 
04:12
One of the most important things in a program is to read user input and in this video I show you how you can do this in Rust. It is done through the stdin struct/stream and in this example we use the read_line method to feed user input from the console into a mutable String. For more info, check out: https://doc.rust-lang.org/std/io/struct.Stdin.html If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1191 dcode
Rust Programming Tutorial #16 - References
 
05:01
In this video I talk about references and borrowing in Rust - there are two types of references: immutable and mutable. Immutable references don't allow you to change the value of the resource you are referring to while mutable references do allow this. As read from the Rust documentation: (https://doc.rust-lang.org/1.12.0/book/references-and-borrowing.html) - You can have multiple immutable references to a variable in the same scope. OR - You can have 0 or exactly 1 mutable reference to a variable in the same scope. Only one at a time. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1880 dcode
appendChild() - Javascript DOM
 
06:02
With the Node.appendChild() method, you are able to add new nodes, or more commonly, HTML Elements to a parent node, or element. In this video we look at how to use this method to add list items to an existing list element as well as converting an array of strings into a bunch of list elements. For your reference: https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1100 dcode
Rust Programming Tutorial #12 - Tuples
 
03:57
In this video I take you through the use of tuples in Rust. Tuples are essentially just a collection of values which may or may not be of the same type - they can even store other tuples! I go over how you can access elements of a tuple and how to use destructing assignment to declare multiple variables from a tuple. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1602 dcode
Rust Programming Tutorial #2 - Hello World using Cargo
 
01:58
In this video I'll be showing you how to make a "Hello World!" application using Cargo for the Rust Programming Language. Cargo is used to build and run your Rust applications and dependencies. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 3951 dcode
Rust Programming Tutorial #21 - Impl Keyword (Implementation)
 
04:13
In this video we take a look at the 'impl' keyword in Rust. We see how we can add methods to a struct to make it really simple and easy to use. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1486 dcode
Form Data (FormData) in Javascript (with AJAX)
 
04:23
The FormData object in Javascript allows you to easily send key-value pairs of information/data with your XML Http Requests (AJAX). You can use this to create forms without refreshing the page or sending general data to a server. In this video we go over how to use FormData in conjunction with an XMLHttpRequest. For your reference: https://developer.mozilla.org/en-US/docs/Web/API/FormData Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 3070 dcode
JavaScript Classes #2: Getters & Setters - JavaScript OOP Tutorial
 
08:07
In JavaScript, you can use "getters" and "setters" within your class definitions to bind a function to a property. Both "getters" and "setters" behave like regular properties so you are able to get and set instance properties but you are able to define your own function to modify the behaviour. They can be useful when you have a class with multiple instance properties and you'd like to compute/set a value while still maintaining loose coupling. In this video I show you a few simple examples of how you can implement your own "getters" and "setters" on your user-defined classes. For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes Support me on Patreon: https://www.patreon.com/dcode Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 944 dcode
Rust Programming Tutorial #38 - HTTP Get Request (reqwest Crate)
 
08:56
Performing a HTTP GET Request is relatively straightforward in Rust. With the use of the reqwest crate, we are able to easily make HTTP requests. After watching this video you should be able to take advantage of HTTP technology and any APIs within your Rust programs. In this video we look at two ways: the long way which provides you more flexibility when things don't go as expected, and a short way to quickly get a response back. For your reference: https://docs.rs/reqwest/0.8.3/reqwest/ If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1000 dcode
Observer Design Pattern in Javascript | Design Patterns Tutorial
 
15:07
In this video I take you through a way we can implement the Observer Pattern using Javascript. The Observer Pattern works by defining a model and then a bunch of other dependencies (observers) on that model - so that when the model changes state, all the dependencies are notified of the change. You will be developing a page with a button, when the button is pressed a number is incremented and a color is chosen at random - the number and color change are represented in the HTML page itself and the console. This was inspired by java.util.Observer and java.util.Observable. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 3271 dcode
Prevent Default Explained in JavaScript | e.preventDefault()
 
05:38
The Event.preventDefault method in JavaScript allows you to prevent the default behaviour from occurring when an event gets fired off - this is going to change depending on the element and context. For example, when dealing with links (anchor elements), the default behaviour would be to redirect to the URL, but with preventDefault() we are able to prevent this from happening. In this video I take you through an example with a link to the YouTube website and how we can use preventDefault() to disable it. I also create a checkbox which enables/disables the link. For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 636 dcode
Class List (classList) Property - Javascript DOM
 
07:23
The 'Class List' (HTMLElement.classList property) allows you to powerfully manipulate the classes attached to an HTML Element. You can use it to add, remove, toggle and even replace classes on an element. In this video we look at a visual example (through the help of CSS) as to how exactly you can use this functionality. For your reference: https://developer.mozilla.org/en-US/docs/Web/API/Element/classList If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1032 dcode
How to use Local Storage in JavaScript
 
15:23
By using Local Storage in JavaScript, you are able to store simple data persistently for your web application directly through the web browser itself - no PHP needed! Data is stored using key-value pairs, string-string. This makes it more than capable of storing basic data which is the intention and recommended use of Local Storage. I wouldn't recommend using Local Storage for large scale applications because even though the data is persistent, it isn't guaranteed to stay there and is only specific on that particular machine. In this video I show you the basics of using Local Storage as well as a mini application that prints out the data stored inside the Local Storage. For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 4666 dcode
JavaScript Classes #5: Polymorphism - JavaScript OOP Tutorial
 
05:43
Polymorphism is the act of overriding methods within a derived class. Suppose you have a class called "CA" with a method "MA" on it - if you were to now create a child class of "CA" and then re-define the method "MA" on it, this would be polymorphism. It is a commonly used technique when dealing with derived classes as in a lot of cases, the child class will be performing the same actions as its parent, but with a little extra. In this video I take you through a simple example of polymorphism using the typical "Animal" class. I also demonstrate how you can call the parent-defined method through the use of "super". For your reference, check this out: https://developer.mozilla.org/en-US/docs/Glossary/Polymorphism Support me on Patreon: https://patreon.com/dcode Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 736 dcode
Rust Programming Tutorial #34 - Multiple Source Files (Modules)
 
04:13
Today we look at how to organise your code better within your Rust projects by creating separate source files (or modules). By doing so, it makes your code much more readable, easier to understand and easier to maintain. We take a look at the 'mod' keyword as well as creating a module, importing it and using it. With this, we also look at public visibility for functions and the assumed private visibility. Take a look here for more information: https://doc.rust-lang.org/book/second-edition/ch07-00-modules.html If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1047 dcode
Array 'forEach' method in Javascript (Array.prototype.forEach)
 
03:28
It's easier than ever to loop through an array in Javascript - in this video I take you through the Array.prototype.forEach() method which allows you to loop through an array in a neat and readable way. We can gain access to each individual array element itself, as well as the current index. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 790 dcode
Get Mouse Position in Javascript ('x' and 'y')
 
04:47
Through using the MouseEvent object, you are able to access the 'x' and 'y' properties, giving you the position of the mouse when that event fired off. In this video we look at using the 'mousemove' event on the Window object, allowing us to constantly update the x and y coordinates in the browser as the mouse moves across. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 975 dcode
The Remainder Operator in JavaScript | Modulo %
 
05:23
The Remainder Operator (%) in JavaScript allows you to find the remainder of a division of two numbers - much similar to the modulo operator in many other languages. It can be used for the same purpose of finding the remainder as it uses the built in modulo function. It is also extremely useful for limiting a large number (or converting it) into a smaller one with a maximum you specify. For example if you wanted to reduce 500 down to a maximum of 7, you can do this easily using the remainder operator. In this video I take you through a basic example of the operator as well as it's uses to limit a number down. For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Remainder_() Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 870 dcode
Rust Programming Tutorial #39 - Enum Methods
 
05:15
Did you know you can add functions/methods to your Enum (enumeration) Types in Rust? It's possible, and quite useful. By implementing your own functions, you can make your code a lot clearer by moving some of the Enum-related logic out of your main functions and into the Enum definition itself. In this video we look at how we can do this through a simple example, featuring the classic 'Day' Enum. We check if a 'Day' is a week day by using a custom-defined method. For your reference: https://rustbyexample.com/custom_types/enum.html If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 756 dcode
Method Chaining Explained (in Computer Programming)
 
06:29
It is common to see the 'method chaining' syntax in source code all across the world and in almost every object oriented programming language. Also called 'named parameter idiom', it looks like a chain of methods being called one after another, hence the name 'method chaining'. It works because the methods that are being called on the object are actually returning the SAME instance of that object, meaning another method of that object can be called right after it nice and easily. In this video I show you an example of how you can implement method chaining in Java by creating a new class that supports it. The class is a simple number wrapper with an addition and print method. For your reference: https://en.wikipedia.org/wiki/Method_chaining If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 843 dcode
Rust Programming Tutorial #9 - For Loop
 
04:28
In this video we take a look at for loops in Rust, which are unconventional compared to other languages such as C or Java. In Rust, you use for loops to loop over iterators. We also look at using the enumerate function to gain access to the index we are currently at in the loop. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1674 dcode
Rust Programming Tutorial #13 - Functions
 
04:50
In this video I go over how you can write and use your own functions using Rust - we look at passing in values and also functions that return data. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1487 dcode
Rust Programming Tutorial #15 - Shadowing
 
02:02
Okay so in this video I talk you through the concept of 'shadowing' in Rust - which is almost like re-assigning a variable within the scope that you're currently in. You can use it to have independent versions of your variables within inner-scopes and freely do modifications on it without having to worry about the effects it would normally have on the outer scope. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1477 dcode
Rust Programming Tutorial #22 - Strings
 
04:05
In this video I go over the String struct found in the Rust Standard Library. We look at a few methods you can use with String, but if you really want to get into it you should check out the String documentation: https://doc.rust-lang.org/std/string/struct.String.html If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1242 dcode
Rust Programming Tutorial #29 - Pattern Matching (Switch Statement)
 
04:36
Similar to a 'switch statement' you might see in other languages, the Match Operator in Rust allows you to do different things based on the value of something else. You can use it to compare numbers, strings etc. In this example we look at numbers and strings, as well as ranges and or's - it is very powerful. It is based on 'patterns' in Rust, for more info: https://doc.rust-lang.org/1.6.0/book/patterns.html If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 990 dcode
Pug (Jade) Tutorial #10 - Mixins | Reusable blocks of code
 
10:06
In Pug (formally known as Jade) you can use 'mixins' in order to create reusable blocks of code - basically it is the implementation of a function in Pug. You're able to pass in data as arguments to a Mixin upon calling one in order to add support for dynamic data. It is "write once, use everywhere". In this video I take you through an example of a Mixin which is responsible for rendering HTML for a comment which accepts data as an argument. I then create multiple 'comment' objects in JavaScript and then render the comments by calling the Mixin. For your reference, check this out: https://pugjs.org/language/mixins.html Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1167 dcode
The "scroll" event in JavaScript | window.onscroll
 
07:11
By making use of the "scroll" event in JavaScript, you are able to react to when the users of your web page scroll down or up. Learn more in this video tutorial. In this video I take you through the usage of the "scroll" event on the Window object. This allows us to listen for when the user scrolls up or down the page - we then implement a function that displays a message box when the user has reached the bottom of the page. Support me on Patreon: https://www.patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience! For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/Events/scroll Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1078 dcode
Rust Programming Tutorial #20 - Arrays
 
04:59
Today we look at how to create and use arrays in Rust - they allow you to store a sequence of data one after another. If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1307 dcode
textContent vs innerHTML in the JavaScript DOM
 
04:38
Although commonly used interchangeably, there is a major difference between the textContent and innerHTML properties when working with Elements in JavaScript, and it's important you know what that is. The major difference is that when using the innerHTML property, the client browser will actually interpret the content as HTML markup, and apply that change to the DOM/Window. On the other hand, the textContent property will only change the the text, preserving any HTML markup. In this video I take you through a basic example to demonstrate that difference. Support me on Patreon: https://www.patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience! For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 389 dcode
Element.setAttribute() - Javascript DOM
 
05:25
If you'd like to modify an attribute of an Element on the fly, you can do so within your Javascript code using the Element.setAttribute method. In this video we look at how we can use this method on a pre-existing element and also on a dynamically created element (through createElement) For your reference: https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 744 dcode
Pug (Jade) Tutorial #6 - For/Each Loop - Iterate over Arrays and Objects
 
07:52
By using the each/for loop in Pug, you are able to easily iterate over an iterable object such as an array or object and then render HTML accordingly, having access to both the key and value of the respective items. In Pug, the each and the for loop do the same thing except they are just aliases for each other, either one will work. In this video I take you through the each loop, with examples of an array and also an object. There is also the 'else' keyword which runs whenever there are no items to iterate over. For your reference, check this out: https://pugjs.org/language/iteration.html Follow me on Twitter @dcode! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Views: 1895 dcode