Javascript

Difference between Client side scripting and Server side scripting

Javascript
Difference between Client side scripting and Server side scripting Client side scripting: It runs/interprets/executes the scripts in end-users browsers. Script source code transfered to browser and run and render the output. Browser can be enabled to stop the scripting execution in their end. Slow, as it runs on end-user/client side. Source code can be viewed. Eg: Javascript, AngularJS   Server side scripting: It runs/interprets/executes scripts in web server itself. Everything done in server only the final html output will be transfered and rendered in client side. As it runs in server side enable/disable of script execution can not be done. Fast, as it runs in server. Source code can not be viewed. Eg: PHP, Node JS, Perl , Java, Python, JSP ...

Difference between Javascript and Typescript

Javascript, Typescript
Difference between Javascript and Typescript: Javascript Typescript var myVar = 'hello'; myVar = 10; console.log(myVar); // prints 10 let myVar = 'hello'; myVar = 10; console.log(myVar) // we get the error here stating //Type 'number' is not assignable to type 'string' We dont have a type number only in javascript. Typescript does not have float/double types, everything is considered as type number only (like 10, 11.2, 27.8000). As types are not supported in javascript, explicit assignments will also be not possible. Explicit assignment is possible let name:string = 'javadomain'; let price:number = 100000; We dont have any types like any, and also it even does not maintain the types internally based on the initialization assignments we can have the ...

Typescript Quick Notes for Angular Developers

Angular, Articles, Javascript, Typescript
Typescript Quick Notes for Angular Developers: As because of angular's reach angular developers are forced to learn typescript. It is not tough but it is better to know the below basic syntax to code faster.   1. Converting array to JSON in typescript   [html] selectedItems = []; JSON.stringify(this.selectedItems); [/html]       2. For loop in typescript   [html] for(let item of items){ console.log(item.itemName) } [/html]   items is an array/collection of item.     3. String concatenation in typescript   [html] appendTxtTemp:string = 'Hello'; this.appendTxtTemp = this.appendTxtTemp.concat(" ") .concat('World'); // prints Hello World [/html]     4. S...

How to install node js in windows 10 ?

Frameworks, Javascript
How to install node js in windows 10 ?   If you want to install NodeJS in Windows 7 then refer the below post: http://www.ngdeveloper.com/3-simple-steps-to-install-nodejs-in-windows-7/   Step 1: Download the nodejs package from the below link: NodeJS Package Download (you can download -> Windows Binary (.zip) 32bit / 64bit based on your OS version).   Step 2: Extract the zip file and keep it where you want I extracted and placed inside C: drive [C:\node-v6.11.3-win-x64]   Step 3: Set the environment path variable Right click on My Computer -> Properties -> Advanced System Settings -> Environment Variables -> Create New under "User Varaibles for" and enter the name as : Variable name: nodejs Variable value: PATH_OF_THE

18 Important Javascript Interview Questions

Javascript
Javascript Interview Questions:     1. Difference between == and === ? == compares only the value. === compares the value along the data type or type of the variable. Eg: 1 == "1" => true;because both has the value 1. 1 === "1" => false;because one is integer and other one is string. So even though it has the same value, because of different data types it returns false. Note: === can be used to compare with null/undefined.   2.Difference between null and undefined ? null is a special object, since it returns the type as "object" and undefined means that variable has not been declared/not been assigned with any value.   3. How do you check a variable is undefined or not ? Undefined variable can be checked using === with typeof
Auto populate one dropdown based on other dropdown value change in Angular JS

Auto populate one dropdown based on other dropdown value change in Angular JS

Javascript, Jquery
Auto populate one dropdown value based on other dropdown value change in Angular JS:   As we know Angular JS is a two way data binding, mapping the $scope variable in the html/view file will map and bind the updated value which we are assigning/updating in the controller.   I recommend you to study Angular JS Hello world for dummies post if you do not have much idea about angular JS.   Requirements: We need jquery.min.js & angular.min.js to work with any angular js module/project. But in our project we used bootstrap for responsive design. So need to include bootstrap.min.js and bootstrap.css file as well. Note: Do not struggle to find the links to download all the below required js and css files, everything you will get by just clicking downl...
AngularJS Hello world for Dummies

AngularJS Hello world for Dummies

Frameworks, Javascript
AngularJS Hello world for Dummies: AngularJS is an open source Model-View-Controller [MVC] Javascript framework initially created by Misko Hevery and Adam Abrons in 2009. Now google maintains this web application open source framework. AngularJS written using Javascript language. AngularJS extends HTML attributes by directives.   What is AngularJS? It is a javascript framework mainly used to create single page applications(SPA's) by extending new HTML attributes. Attributes can be added using directives. Data binding can be done using expressions. AngularJS Basics: Directives Expressions Filters Modules Controllers   Advanced concepts: Events DOM Forms Input Validations     Why AngularJS ? AngularJS can
Developing Gmail Inbox extensions using inboxSDK

Developing Gmail Inbox extensions using inboxSDK

Javascript
Developing Gmail Inbox extensions using inboxSDK: InboxSDK: What is InboxSDK ? InboxSDK is a platform to develop extensions/plugins for gmail inbox. It's just a single JS file which you can download from InboxSDK.     Extension in Gmail ? Where can I find it? Yes. It's a extension in gmail. You can find in sidebars, new compose messages/reply messages etc., New message widget:       How to develop a hello world extension using inbox SDK for gmail ? Requirements: inboxSDK.js App ID [It can be registered here, AppId Registration].       manifest.json: Place where we need to load the inboxsdk js and our own js[here myapp.js - main logics/business] file. [xml] { "manifest_version"
Prompt before closing the browser tab example

Prompt before closing the browser tab example

Javascript
Prompt before closing the browser tab: In realtime web applications like shopping websites and multi tab registration websites we wanted to show the confirmation prompt before closing the browser tab. Because user would have clicked the close button by mistake/without knowing. If we close the tabs without letting him, then he may lost the data's which he entered.   For example in shopping websites  if user is in payment page and he closed the tab without knowledge/by mistake then he need to navigate from first page to payment page again if we would have not asked for the confirmation prompt popup.   Javascript Source code to display the prompt before closing the browser tab: [html] <script type="text/javascript"> window.onbef
Click to copy to clipboard jQuery

Click to copy to clipboard jQuery

Javascript, Jquery
Click to copy to clipboard jQuery:     If you look at the coupon websites, they will copy the coupon you clicked to your clipboard.       Plugins Required for click to copy to clipboard: 1. jQuery Plugin [jquery.min.js] 2. zClip Plugin [jquery.zclip.js]   Click to Copy to clipboard jQuery source code: [html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Click To Copy | Javadomain.in</title> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11...