Learning Javascript

javascriptHi guys, it’s been a while since I posted another blog update. I’d been busy with a lot of things, mainly with work that I don’t have enough time and the energy to write something new nor do I have time to study, but right now, I’m trying to make some time so please bear with me.

Currently, I’ve been busying myself with Javascript. This is something I learned recently from self-study… while it’s not something new and perhaps a lot of you guys have already heard it, I’m here to share what I have learned more about it. Before, I just dismissed it as nothing too important, well, since most of my work involves back end stuff and I have really no much use of it. But, after realizing there are things Javascript can do, which other programming languages such as PHP can’t, and after being made to create a page with functions that requires cross-browser compatibility, I was motivated to study it.

The demands of the IT industry nowadays have step up. Most companies are now looking for Full Stack Developers. These are developers who know more than just one programming language, and who can learn more at a moment’s notice. Perhaps, it’s the way for companies to save money, since instead of hiring more developers who knows another language, they can just hire one who knows a lot and get the same amount of productivity. Well, I also think that it’s practical that way… even while working as an individual. Learning more than one language allows you to be flexible and allows you to work with less supervision and without having to rely on others, which in contrast, promotes more independence and greater potential.

Now, enough with the chit-chat. So, in the past, I’ve been already implementing Javascripts in my websites, most of them, stolen from other websites… and yes, you can actually steal the codes. If you find a page with a Javascript and you save that page as html, it will be saved as an html file in your PC along with the css, images, folders, and javascripts. Then I copy the .js file into my own folder and attached it into my html page using the script source code:

<script type="text/javascript" src="thisjavascript.js"></script>

With this simple trick, I manage to get some cool effects running on my page even though I don’t know how to make one in javascript. However, this method is that of a lazy-ass and bad in a way since you’re stealing other people’s hard work, and if left alone on your own, you will be rendered incapable. So, to be a capable developer, you have to stop relying on other people and learn Javascript from scratch.

Now, back in the old days, programming knowledge was scarce, and in the country where I came from, we’re like in the stone age when it comes to technology. You can’t even learn so many good stuff in school as we were using old “obsolete” languages and methods when the rest of the world were already achieving milestones. Fortunately, we’re in the 2019 now. You can find so much resource anywhere… thanks to the World Wide Web.

Among the best tutorials I found is from mmtuts. This guy is definitely god-sent. This youtuber made learning Javascript so easy, even more easier when you already know other program languages such as PHP. However, you at least need to understand HTML and CSS before you should take these tutorials since this language runs on top of them. In this case, HTML and CSS acts like your foundation and without them, the tutorial will make less sense. Here’s the Javascript introduction videos.

For Javascript definition, we have Wikipedia for that, but Javascript in my own understanding is a front end program language that runs in a web browser, and unlike PHP, which is server-side and requires a server to run the code, Javascript is executed directly by the web browser. Javascript does not need to be reloaded each time to send a request, unlike PHP. And as one of the main components of the World Wide Web, along with HTML and CSS, most if not all, web browsers support it. In the past, it only used to provide effects that are not possible with just HTML and CSS, but overtime, Javascript has grown to be a powerful programming language, being able to manipulate the content of the web page and process functions and server requests that only used to be something only PHP could. It is also capable of creating files and even issue commands that can be executed by your PC’s operating system. Although it has no I/O capability, it makes use of other programs, such as a Web Browser, to execute its commands.

So far, I’m in the “Hello World” part of the learning process. If I learn more, or if I write some nifty JS codes, I’ll be sure to share them all up here in my site under the Tutorials/Programming/Javascript menu link of this site. For now, here’s a little something I learned…

<html>
<head>
<title>Test Page</title>
</head>
<body>
<script type="application/javascript">
	document.body.innerHTML = "Hello World!";
</script>
</body>
</html>

document.body.innerHTML targets the document’s body, particularly the inner part of the HTML. This command will modify the body of the page and display the declared value. In this case, “Hello World”. That’s why you get this…

testpage

Note that it needs to find a body in order for it to work. If there is no <body> tag, then there is nothing to modify. Which is why the javascript has to be within the body of the document or page.

Follow me at:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.