All chores can be done by JavaScript

With JavaScript, you can do a lot of awesome things. From robotics to web app developing, JavaScript is a strong tool. Let's see how people use JavaScript in their tech life:

  • Robotics
  • 3D games
  • Making apps for your smartphones
  • Running web servers
  • Running Ruby and Python
  • Writing OS independent desktop applications
  • Web scraping and screenshotting
  • Web analytics
  • Responsive and interactive contents
  • Animation
  • Creating cookies

Robotics

In robotics, you need to control your robot with logics. In real world, the logics are handled by microcontrollers. You may have heard of Arduino, an open source hardware that deals with microelectronics. Basically, Arduino controls microcontrollers using C code. However, if you know JavaScript, you can also code for it; to work with microprocessor/microcontroller and make your first robot. You can get help from http://nodebots.io/ in order to see how JavaScript is used to build robots. Following is an image of Arduino UNO board:

Robotics

An Arduino UNO

3D games

We have built and developed 2D games in this book. However, trust me, you can also build awesome 3D games with JavaScript. You can even play them via your favorite gamepad. To play with your gamepad, you need to use a gamepad API (https://wiki.mozilla.org/GamepadAPI).

You can play few online 3D games build with JavaScript at the following URL: http://www.babylonjs.com/.

Making apps for your smartphones

Have you ever thought of building an app for your smartphone? You can build apps for your smartphones with JavaScript. There are different types of platforms for smartphones (for example, Android, iOS, Tizen, Firefox OS, and so on). Every platform has its own APIs and uses different programming languages. Therefore, we need to consider that our code base may run on any device. To make sure about this, we can use the JavaScript engine as it runs on any platform. You can use Cordova (http://cordova.apache.org/) to understand how to build apps using JavaScript. Cordova is a JavaScript framework based on every device's APIs. You can use PhoneGap (http://phonegap.com/) or Meteor (https://www.meteor.com/) to build smartphone apps with JavaScript.

Running web servers

You probably have heard of web servers. The server is used to broadcast websites. You can rule your server using JavaScript. JavaScript can handle all the operations and confirms the security of your domains. You can use Node.js (https://nodejs.org/) to run the simplest web server. To know more about the JavaScript web servers, you can take a look at https://www.firebase.com/. You may have basic knowledge of JavaScript, which is needed to perform the tasks in a web server. Building a web server with other framework may have a high cost; however, with JavaScript, you can do it for free, You don't even need to buy any software for this.

Running Ruby and Python

JavaScript also can be used to run Python or Ruby on your browsers with few lines of external code. You may include the running environment of these programming languages on your browsers by adding libraries. To learn more about library including and running the codes of Ruby and Python on your browser, you may take a look at https://www.firebase.com.

Writing OS-independent desktop applications

Since JavaScript is platform-independent, you can build web applications with the help of JavaScript and run them on any platform. Users on any platform can run the JavaScript-based apps on their browsers. You can even make desktop applications using JavaScript. Take a look at http://appjs.com/ and http://electron.atom.io/ to make your first desktop application based on JavaScript.

Web scraping and screenshotting

The technique of extracting information from a website is called web scraping. To learn more about web scraping you can head to http://www.webscraper.io/. JavaScript can help you with web scraping. You can take a look at http://nrabinowitz.github.io/pjscrape/ to learn more about web scraping with JavaScript.

You can take a look at https://html2canvas.hertzen.com/ to learn more about screenshotting of your website. Screenshotting can be done using JavaScript.

Web analytics

Sometimes, you may need to know who is visiting your website, from which IP address is your website regularly being visited, which country does the visitor belong to, and a lot more information about tracking the visitors. All of this information can be obtained using JavaScript.

Responsive and interactive contents

With JavaScript, you can make responsive and interactive contents on your website and web application. You can take a look at http://beta.rallyinteractive.com/, http://www.unfold.no/, http://www.2advanced.com/, and http://www.newquest.fr/ to see how they made their website responsive and interactive using JavaScript.

Animation

The awesome thing about JavaScript is that you can do animation with it. There are a lot of cool JavaScript animation libraries. Take a look at http://greensock.com/gsap to learn more about GreenSock, a famous JavaScript animation library. There is another famous library for JavaScript animation named Velocity.js (http://julian.com/research/velocity/).

Creating cookies

You may have heard about web cookies. Consider that you input your username and password on a website, there popped up an alert stating that you can save the username and information. You hit Remember Password and the information is then stored in your computer as cookie. Your web cookies are created with JavaScript. The web cookies are important for a website to load faster. You can learn more about web cookies from http://www.allaboutcookies.org/cookies/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.10.137