Skip to main content

Posts

Docker Installation Setp By Step

Installation   Welcome to Docker! This guide will take you through the various mini-tutorials to help you understand Docker. Setup The first step is to ensure that you are on a Windows laptop. Docker does not run natively on Windows or Mac OS X. But help is at hand. All you need to do is use a tiny Linux VM that you can use to run Docker images and container. This tiny VM is packaged in a nice utility called  boot2docker  and that is what we will install next. From the  official Github page , “Boot2Docker is a lightweight Linux distribution made specifically to run  Docker  containers. It runs completely from RAM, is a small ~24MB download and boots in ~5s”. Update : 15-Aug 2015 :  Boot2Docker has now been deprecated in favor of Docker Machine. But you can still go ahead and install Boot2Docker since behind the scenes on Windows / Mac OS, it still runs the Boot2Docker image. So conceptually, everything will remain the same. Check out the  boot2docker.io  home page for more detail
Recent posts

JavaScript - Window Navigator

JavaScript Window Navigator The window.navigator object contains information about the visitor's browser. Window Navigator The  window.navigator  object can be written without the window prefix. Some examples: navigator.appName navigator.appCodeName navigator.platform Navigator Cookie Enabled The property cookieEnabled returns true if cookies are enabled, otherwise false: Example < p  id= "demo" > < /p > < script > document.getElementById("demo").innerHTML = "Cookies Enabled is " + navigator.cookieEnabled; < /script > The Browser Names The properties  appName  and  appCodeName  return the name of the browser: Example < p  id= "demo" > < /p > < script > document.getElementById("demo").innerHTML = "Name is " + navigator.appName + ". Code name is " + navigator.appCodeName; < /script > Did you know? IE11, Chrome,

JavaScript - Popup Boxes

JavaScript Popup Boxes JavaScript has three kind of popup boxes: Alert box, Confirm box, and Prompt box. Alert Box An alert box is often used if you want to make sure information comes through to the user. When an alert box pops up, the user will have to click "OK" to proceed. Syntax window.alert(" sometext "); The  window.alert()  method can be written without the window prefix. Example alert("I am an alert box!"); Confirm Box A confirm box is often used if you want the user to verify or accept something. When a confirm box pops up, the user will have to click either "OK" or "Cancel" to proceed. If the user clicks "OK", the box returns true. If the user clicks "Cancel", the box returns false. Syntax window.confirm(" sometext "); The  window.confirm()  method can be written without the window prefix. Example var r = confirm("Press a but

JavaScript - Testing Prototype

JavaScript - Testing Prototype Testing JavaScript Framework Libraries - Prototype Including Prototype To test a JavaScript library, you need to include it in your web page. To include a library, use the <script> tag with the src attribute set to the URL of the library: Including Prototype < !DOCTYPE  html > < html > < head > < script  src= "http://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js" > < /script > < /head > < body > . . . Prototype Described Prototype provides functions to make HTML DOM programming easier. Like jQuery, Prototype has its $() function. The $() function accepts HTML DOM element id values (or DOM elements), and adds new functionality to DOM objects. Unlike jQuery, Prototype has no ready() method to take the place of window.onload(). Instead, Prototype adds extensions to the browser and the HTML DOM. In JavaScript, you can assign a function

JavaScript FAQs

Are the JavaScripts here free? What is the catch? Yes, we offer our site as a free "public service" resource. Simply stated, all the scripts on this site are free for personal or business use. The only requirement for use of archives is that you leave the credit information inside the script. We also don't think it's too much to ask if you would please link back to The JavaScript Source site to help spread the word about our site. The address for linking to The JavaScript Source is: http://www.JavaScriptSource.com Thanks! Do you write all the JavaScripts in this site? No, of course not. There are several thousand of them! What we do is collect many from across the Net and provide them in an organized and useful way. (We also write a portion of them.) If we have collected it from the Net, it will have the author credit info in the script. If there is not credit info, just the one for our site, then we wrote it or it is a 'public domain' script

JavaScript - Scope and Events

JavaScript Scope Scope is the set of variables you have access to. In JavaScript, objects and functions are also variables. In JavaScript, scope is the set of variables, objects, and functions you have access to. JavaScript has function scope: The scope changes inside functions. Local JavaScript Variables Variables declared within a JavaScript function, become  LOCAL  to the function. Local variables have  local scope : They can only be accessed within the function. Example // code here can not use carName function myFunction() {     var carName = "Volvo";      // code here can use carName } Since local variables are only recognized inside their functions, variables with the same name can be used in different functions. Local variables are created when a function starts, and deleted when the function is completed. Global JavaScript Variables A variable declared outside a function, becomes  GLOBAL . A

JavaScript Array Methods

JavaScript Arrays JavaScript arrays are used to store multiple values in a single variable. Displaying Arrays In this tutorial we will use a script to display arrays inside a <p> element with id="demo": Example < p  id= "demo" > < /p > < script > var cars = ["Saab", "Volvo", "BMW"]; document.getElementById("demo").innerHTML = cars; < /script > The first line (in the script) creates an array named cars. The second line "finds" the element with id="demo", and "displays" the array in the "innerHTML" of it. Example var cars = ["Saab", "Volvo", "BMW"]; Spaces and line breaks are not important. A declaration can span multiple lines: Example var cars = [     "Saab",     "Volvo",     "BMW" ]; Never put a comma after the last element (like &