Javascript Archive
12 Apr 2016
jQuery tricks for DOM Manipulation

jQuery tricks for DOM Manipulation In this article we will explore jQuery’s methods that help a web developer in their daily work. 1. Changing attributes with jQuery We can change HTML DOM elements like Divs, Lists, form elements etc ‘s attributes using jQuery very easily. addClass We can use add class to each set of
01 Feb 2015
Insert a document using NodeJs and mongoDB

Insert a document using Node.js and mongoDB Suppose you have a mongoDB database for courses and you want to insert a record into the database using Node.js. First step is to install mongoDB driver for Node.js If it is not already installed. Please open command line and run following command. > npm install mongodb This
17 Jan 2015
NodeJs and Express framework basics

NodeJs and Express framework basics We have already learned how to select data from MongoDb using Nodejs findOne. In this article we will create a baisc Hello World program using NodeJs and Express. Consider a following program below. var express = require('express'), app = express(); app.get('/', function(req, res) { res.send("Hello World!"); }); app.get('*', function(req, res)
12 Jan 2015
Node Js, MongoDb select record with findOne

Node Js, MongoDb select record with findOne To select a single record from mongoDB database using findOne() function in Node Js var MongoClient = require('mongodb').MongoClient; //Open the connection to server MongoClient.connect('mongodb://localhost:27017/test', function(err, db){ if(err) throw err; db.collection('people').findOne({}, function(err, doc){ if(err) throw err; console.log(doc); db.close(); }); console.dir("Called findOne"); }); In the code below we use require
10 Jan 2015
Angular Js – Introduction

Angular Js – Introduction Angular Js is very popular JavaScript Framework. We can say it a futuristic web standard for web development. It is developed and supported by Google and has a huge vibrant community of users. Angular is in class of frameworks that are called Data Bindings Frameworks. These data bindings frameworks are used
16 Sep 2014
NodeJS – select data from mongoDB collection

Suppose we have a collection in MongoDB database, We want to select data from collection then we can do like the program below. Suppose we have a collection ( Like table in Relational DBMS) named grades and this collection is in course database. Grades collection contains fields like _id, student, grade and so on… now
07 Jan 2014
Node JS – Reading command line input

In languages like c++, java we can take command line input from user using standard i/o libraries. But JavaScript is used in browser and we never need to take input from user on command line, here Node JS fills the gap using its own libraries know as modules.
12 Nov 2013
JQuery – How go to anchor tag without showing hashtag in URL

We use named anchors or # tags to access certain part of a page like http://www.example.com#middle. Now clicking on this tag will take user to this tag but it will show whole url in address bar. If we want not to show # url in address bar but want to use named anchors. Use Jquery
01 Nov 2013
What is Node.JS

Node.js is an upcoming new technology that has already got a lot of attention. Top notch tech companies like Microsoft, VMWare, Ebay, Yahoo, and many more are using node. Node.js is the amazing skill to open up new career opportunities for a programmer.