Monday 12 October 2015

onTouch Dictionary - pop up




The offline English pop up dictionary : onTouch dictionary by adroit apps - shows the definition/meaning of words as pop up or toast. Now word lookup is so easy. It is just like a pocket dictionary. No switching between app is required.

Get ready to download: it works offline that is only one time download and afterwards, no need of internet connection.
Here's how to use it:
1- Hold and select the word you'd like to get the definitions/meaning.
2- Select the Copy button in the menu/Action Bar.

3- And your meaning will be shown as pop up /toast on a screen.
4- Pop up is visible until user closes it.

5- You can also hear the pronunciation of word directly from that pop up window.
Features:
* More than 450000 words
* Get an instant definition of any word. Simply select the word and then click on the copy button, and its meaning/definition will be displayed over currently visible application at instant.
* Depth search is also provided i.e. find the meaning of any word from the definition to any depth.
* Text to Speech is available, i.e. you can easily get the pronunciation of any words simply by selecting and copying the word.
* Compatible with Browsers, Moon+ Reader, WhatsApp and many more
* Fast as it is offline dictionary. (Internet connection is not required).
* The application gets started automatically during the booting up of the device, and works from the background. This feature can also be turned on/off from the settings of the main application.
* User can also look up for the definition of any word, just like any other dictionary application.
* You can also add a new word of our choice with your own sense of understanding.
* Customize the dictionary by adding new words and/or modifying the definition of existing words.
* A list of recently searched word for quick references.
Please send your request and feedback by email.
Keywords : popup dictionary, onscreen dictionary, free dictionary, English, offline dictionary, android dictionary, floating dictionary, floating pronunciation, depth search, Adroit apps

Learn PL/SQL Part 6- PL/SQL Tutorial

Thursday 17 September 2015

How to use Comparator in java?


import java.util.*;

class ComparatorTest {
    public static void main(String[] args) {
        List list = new ArrayList<>();
        list.add(new Employee("B", 3));
        list.add(new Employee("A", 1));
        list.add(new Employee("C", 2));

        Collections.sort(list, new EmployeeComparator());
        for (Employee emp : list) {
            System.out.println(emp.name + "\t" + emp.age);
        }
    }
}

class EmployeeComparator implements Comparator<Employee> {
    @Override
    public int compare(Employee o1, Employee o2) {
        if (o1.age > o2.age) {
            return -1;
        } else {
            return 1;
        }
    }
}

class Employee {
    String name;
    int age;

    public Employee(String name, int age) {
        this.name = name;
        this.age = age;
    }
}



Output:

B 3
C 2
A 1

Friday 7 August 2015

How to make a div scroll-able?



To make div horizontally scroll-able add overflow-x:scroll style to div as:


<div style="overflow-x: scroll; width: 300px;">
In HTML, span and div elements are used to define parts of a document so that they are identifiable when no other HTML element is suitable.
<div>




To make div vertically scroll-able add overflow-y:scroll style to div as:


<div style="overflow-y: scroll; height: 300px;">
In HTML, 
span and div elements are used 
to define parts of a document 
so that they are identifiable 
when no other HTML element is suitable. 
<div>


To make div  scroll-able both horizontally & vertically then  add overflow:scroll style to div as:


<div style="overflow: scroll; height: 300px; width:400px;">
In HTML, 
span and div elements are used 
to define parts of a document 
so that they are identifiable 
when no other HTML element is suitable. 
<div>

Thursday 6 August 2015

Add Lyrics to mp3 file using Windows Media Player in simple steps



Download the Lyrics Plugin for Windows Media Player from www.lyricsplugin.com

Install it and play any song.

Click [Search Google] to find the lyrics of that song. Copy the lyrics.

Click [Edit] and paste the copied lyrics in lyrics textbox, you can also change the Title and Artist.
Click Save Changes

Now whenever you open that song you can see the lyrics of that song

Tuesday 4 August 2015

Applet Demo 1



Source Code:


import java.applet.*;
import java.awt.*;


public class Demo1 extends Applet
{
    public void init()
    {
        //Code to run automatically
        this.setSize(500, 500);
        this.setBackground(Color.CYAN);
    }
    public void paint(Graphics g)
    {
        
        
        //now draw graphics
        g.drawLine(0, 0, 100, 100);
        g.drawRect(0, 0, 100, 100);
        
        //change color of graphics
        g.setColor(Color.blue);
        g.drawString("Applet Demo", 0, 120);
    }
}

Monday 3 August 2015

Getting Started with Java GUI Programming



Download the Netbeans IDE from filehippo.com/download_netbeans

Also download Java JDK(32-bit or 64-bit) according to your operating system. For 32-bit operating system download the 32-bit version of Java JDK and for 64-bit operating system download the 64-bit version of Java JDK

After downloading firstly install Java JDK and then Netbeans

Sunday 2 August 2015

Binary Search Program



#include<iostream.h>
#include<conio.h>
void main()
{ 
 clrscr();
int n,*a,item,loc=-1;
cout<<"\nenter the no. of elements :";
cin>>n;
a=new int[n];  //dynamically initialize array
cout<<"\nenter the elements:\n";
for(int i=0;i<n;i++)
cin>>a[i];
cout<<"\nenter the element you want to search: ";
cin>>item;
int mid,end=n,beg=0;
while(beg<=end&&loc==-1)
{
 mid=(beg+end)/2;
 if(a[mid]==item)
  loc=mid; 
 else if(a[mid]<item)
  beg=mid+1;
 else
  end=mid-1;
}
if(loc!=-1)
      cout<<"\nlocation of "<<item<<" is:"<<loc+1;
else
      cout<<"\n"<<item<<" not found!!!";
getch();
}

Linear Search Program



#include<iostream.h>
#include<conio.h>
void main()
{     clrscr();
int  *a,n,loc=-1,item;
cout<<"\nenter the no. of elements (max. 10):";
cin>>n;
a=new int[n];  //dynamically initialize array
cout<<"\nenter the elements:\n";
for(int i=0;i<n;i++)
cin>>a[i];
cout<<"\nenter the element to be searched: ";
cin>>item;
for(i=0;i<n;i++)
      if(a[i]==item)
      {      loc=i;
             break;    
      }
if(loc==-1)
     cout<<"\n"<<item<<" not found!!!";
else
     cout<<"location of "<<item<<" is: "<<loc+1;
getch();
}

Selection Sort Program



#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,temp,min;
cout<<"\nEnter the no. of elements you want:";
cin>>n;
int *a=new int[n];  //dynamically initialize array
cout<<"\nEnter the elements:\n";
for(int i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
{
 min=i;
 for(int j=i+1;j<n;j++)
 {
  If(a[min]>a[j])
   min=j;
 }
 temp=a[min];
 a[min]=a[i];
 a[i]=temp;
}
cout<<"\nSorted list of given integers is(in ascending order) :\n";
for(i=0;i<n;i++)
cout<<a[i]<<" ";
getch();
}



Bubble Sort Program


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,temp;
cout<<"\nEnter the no. of elements you want:";
cin>>n;
int *a=new int[n];  //dynamically initialize array
cout<<"\nEnter the elements:\n";
for(int i=0;i<n;i++)
cin>>a[i];
for(i=0;i<n;i++)
{
 for(int j=0;j<n-i-1;j++)
 {
  if(a[j]>a[j+1])
  {
   temp=a[j];
   a[j]=a[j+1];
   a[j+1]=temp;
  }
 }
}
cout<<"\nSorted list of given integers is(in ascending order) :\n";
for(i=0;i<n;i++)
cout<<a[i]<<" ";
getch();
}



Merge Sort Program


#include<iostream.h>
#include<conio.h>
#include<values.h>
void merge(int a[],int p,int q,int r)
{
 int n1=q-p+1,n2=r-q;
 int *l=new int[n1+1];
 int *rt=new int[n2+1];
 for(int i=0;i<n1;i++)
       l[i]=a[p+i];

 for(int j=0;j<n2;j++)
  rt[j]=a[q+j+1];  
 l[n1]=MAXINT;   //SENTINEL
 rt[n2]=MAXINT;  //SENTINEL
 i=j=0;
 for(int k=p;k<=r;k++)
 {
  if(l[i]<=rt[j])
  {
   a[k]=l[i];
   i+=1;
  }
  else
  {
   a[k]=rt[j];
   j+=1;
  }
 }
}
void mergesort(int a[],int p,int r)
{
 int q;
 if(p<r)
 {
  q=(p+r)/2;
  mergesort(a,p,q);
  mergesort(a,q+1,r);
  merge(a,p,q,r);
 }
}
void main()
{
 clrscr();
 int n;
 cout<<"\nEnter the no. of elements you want:";
 cin>>n;
 int *a=new int[n];  //dynamically initialize array
 cout<<"\nEnter the elements:\n";
 for(int i=0;i<n;i++)
  cin>>a[i];

 mergesort(a,0,n-1);
 cout<<"\n\nSORTED ARRAY IS:\n";
 for( i=0;i<n;i++)
  cout<<a[i]<<" ";
 getch();
}



Quick Sort Program




#include<iostream.h>
#include<conio.h>
int partition(int a[],int p,int r)
{
int x,i,temp;
x=a[r];
i=p-1;
for(int j=p;j<r;j++)
{
   if(a[j]<=x)
   {
   i=i+1;
   temp=a[j];
   a[j]=a[i];
   a[i]=temp;
   }
}
temp=a[i+1];
a[i+1]=a[j];
a[j]=temp;
return i+1;
}
void quicksort(int a[],int p,int r)
{
int q;
  if(p<r)
  {
   q=partition(a,p,r);
   quicksort(a,p,q-1);
   quicksort(a,q+1,r);
  }
}
void main()
{
clrscr();
int *a,n;
cout<<"\nEnter the no. of element you want:";
cin>>n;
a=new int[n];  //dynamically initialize array
cout<<"\nEnter the elements:\n";
for(int i=0;i<n;i++)
 cin>>a[i];
quicksort(a,0,n-1);
cout<<"\nSorted Array is:\n";
for(i=0;i<n;i++)
cout<<a[i]<<" ";
getch();
}

Heap Sort Program


#include<iostream .h>
#include<conio .h>
int heapsize,length;
void exchange(int &a,int &b)
{
 int temp;
 temp=a;
 a=b;
 b=temp;
}
void maxheapify(int a[],int i)
{
 int l,r,largest,temp;
 l=2*i;               //left[i]
 r=2*i+1;         //right[i]
 if(l<=heapsize&&a[l]>a[i])
  largest=l;
 else
  largest=i;

 if(r<=heapsize&&a[r]>a[largest] )
  largest=r;
 if(largest!=i)
  {
  exchange(a[i],a[largest]);
   maxheapify(a,largest);
  }
}
void buildmaxheap(int a[])
{
 heapsize=length;
 for(int i=length/2;i>=1;i--)
  maxheapify(a,i);
}
void heapsort(int a[])
{
 buildmaxheap(a);
 for(int i=length;i>=2;i--)
 {
  exchange(a[1],a[i])  ;
  heapsize-=1;
  maxheapify(a,1);
 }
}
void main()
{
clrscr();
int *a,n;
cout<<"\nEnter the no of element you want(max 20):";
cin>>n;
length=n;
a=new int[n+1];   //DYNAMICALLY INITIALISE ARRAY,AS ARRAY MUST START FROM INDEX 1 SO SIZE IS (N+1)
cout<<"\nEnter the elements:\n";
for(int i=1;i<=n;i++)
 cin>>a[i];
heapsort(a);
cout<<"\nSorted Array is:\n";
for(i=1;i<=n;i++)
cout<<a[i]<<" ";
getch();
}

Computer Peripherals & Interfaces (CPI) Notes

Computer Graphics Notes

Remove all hyperlinks from a word file

  1. To remove a single hyperlink without losing the display text or image, right-click the hyperlink, and then click Remove Hyperlink. To remove all hyperlinks in a document, press CTRL+A to select the entire document and then press CTRL+SHIFT+F9.

Learn Java Part 11

for each loop in java



What is for each loop?

for each loop in java is the enhanced version of for loop. It is introduced from JDK 5. It is used to iterate all elements of an array or Collection.




Syntax:



for ( data-type variableName :  array or collection )

{

    //statements

}


Consider the following program:

public class ForEachLoop
{
    public static void main(String[] args)
    {
        int[] array ={ 1, 2, 3, 4, 5 };
        System.out.println("Array elements: ");

        for(int element: array)
               System.out.print(element+"  ");

    }
}



Write the above program in Notepad and save it as ForEachLoop.java 

Compile and run it to get the following output:



Array elements: 

1  2  3  4  5



the loop for(int element: array)

fetches the elements of array and assign it to variable element so we can use element to access the elements of array



Consider the following program to access elements of multi-dimensional array



public class ForEachLoop
{
    public static void main(String[] args)
    {
     int[][] array ={ {1, 2, 3, 4,},{ 5,6,7,8} }; //array with 2 rows and 4 columns
        System.out.println("Array elements: ");
        for(int[] row: array)
            for(int element: row)
               System.out.print(element+"  ");
    }
}

Write the above program in Notepad and save it as ForEachLoop.java 

Compile and run it to get the following output:



Array elements: 

1  2  3  4  5  6  7  8



the loop for(int[ ] row: array)

fetches one row of array and assign it to variable row so we can use row to access one row(or one dimensional array) of array



the loop for(int element: row)

fetches the elements of row and assign it to variable element so we can use element to access the elements of row

Command Line Arguments




public class CommandLineArguments
{
    public static void main(String[] args)
    {
        System.out.println("Total number of Command Line Arguments: "+args.length);
        System.out.println("Command Line Arguments:");
        for(int i=0;i<args.length;i++)
            System.out.println(args[i]);
    }
}


Type the above program in Notepad and Save it as CommandLineArguments.java

Compile like this:



javac  CommandLineArguments.java



Run like this:



java  CommandLineArguments   Arguments



For example: 


java  CommandLineArguments   Hello World

output:



Total number of Command Line Arguments: 2

Command Line Arguments:

Hello

World






If you run like this:

java  CommandLineArguments

output:



Total number of Command Line Arguments: 0

Command Line Arguments:






Note: Each argument in command line arguments is seperated by a space

Learn Java Part 10

Monday 22 June 2015

Learn Java Part 9

Learn Java Part 8

How to get an alert when anyone logs into your Facebook account from a new device or browser?



Follow these steps:





  • Log In into your Facebook account and goto Settings.
  • Then Jump to “Security Settings” Tab and You can see a Login “Login Alerts” and Click on “Edit”.
  • Check the Get notifications
  • If you want to receive emails alerts then check it
  • If you want to receive text messages alerts then check it
  • Click Save Changes and enter your current password and click Submit





  • Your changes will be saved and now will get an alert when anyone logs into your Facebook account from a new device or browser


Program to calculate how many times a word occurs in a given string in just one line




//Program to calculate how many times a word occurs in a given string in just one line

import java.io.*;  //for IOException, BufferedReader, InputStreamReader
class CountWord
{
  public static void main(String args[]) throws IOException
  {
     System.out.println("Enter the string: ");
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     String s=br.readLine();  //Gets a string from user
     System.out.println("Enter the word to search for: ");
     String word=br.readLine();  //Gets a string from user

     int count=(s.length()-s.replace(word+"", "").length())/word.length();     

   System.out.println(word+" occurs in given string for: "+count+" times");
  }
}

Wednesday 17 June 2015

Program to reverse each word of a given string




//Program to reverse each word of a given string

import java.io.*;  //for IOException, BufferedReader, InputStreamReader
import java.util.*;  //for StringBuffer
public class WordReverse {
    public static void main(String[] args)throws IOException
    {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter the string:");
    String str=br.readLine();
    StringTokenizer st=new StringTokenizer(str);
    String temp="";
    while(st.hasMoreTokens())
    {
        temp=temp+new StringBuffer(st.nextToken()).reverse().toString()+" ";
    }
        System.out.println("Reversed String is:");
        System.out.println(temp);
    }   
}




Output:



Enter the string:

Hello this is GsbProgramming

Reversed String is:

olleH siht si gnimmargorPbsG 

Saturday 13 June 2015

Program to calculate how many times a word occurs in a given string




//Program to calculate how many times a word occurs in a given string

import java.io.*;  //for IOException, BufferedReader, InputStreamReader
class CountWord
{
  public static void main(String args[]) throws IOException
  {
     System.out.println("Enter the string: ");
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     String s=br.readLine();  //Gets a string from user
     System.out.println("Enter the word to search for: ");
     String word=br.readLine();  //Gets a string from user

     int count=0,pos=0;
     while(true)
     {
        pos=s.indexOf(word,pos);
        if(pos==-1)
            break;
        else
        {
            count++;
            pos++;
        }
      }

   System.out.println(word+" occurs in given string for: "+count+" times");
  }
}


Program to calculate the frequency of each character in given String


//Program to calculate the frequency of each character in given String

import java.io.*; //for IOExecption, BufferedReader, InputStreamReader
class CharacterFrequency
{
  public static void main(String args[]) throws IOException
  {
     System.out.println("Enter the string: ");
     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     String s=br.readLine(); //gets a string from user
     String temp=s;
     System.out.println("\nFollowing are the characters in string");
    
     while(temp.length()!=0)
     {
        char ch=temp.charAt(0);
        int count=0;
        for(int i=0;i<temp.length();i++)
          if(temp.charAt(i)==ch)
            count++;
        System.out.println(ch+": "+count);
     temp=temp.replace(ch+"","");  //replaces the current character with empty string
     }
  }
}

Monday 8 June 2015

Printing different patterns of Stars with the help of nested for loop

Naming, Compiling and Running Java Files Containing More Than One Class Definitions



Today we will see how to name, compile and running java files containing more than one class definitions.



1). Consider the following program.















class ClassOne
{
     public static void main(String[] args)
     {
         ClassTwo.methodOfClassTwo();
     }
}
class ClassTwo
{
     static void methodOfClassTwo()
     {
         System.out.println("From Class Two");
     }
}


Naming : You can save this program with any name. It can be ClassOne.java or it can be ClassTwo.java or it can be anything.java.



Compile : You have to compile this program with the name you have given like >javac ClassOne.java or >javac ClassTwo.java or >javac anything.java.

When you compile a java file, the number of .class files
generated will be equal to number of class definitions in it. i.e If a
java file has one class definition, one .class file will be generated.
If it has two class definitions, two .class file will be generated and
so on.

Running : That means for the above program, two .class files will be generated. Then which one to run? is it >java ClassOne or is it >java ClassTwo…..    It must be >java ClassOne, because execution of any java program start with main() method. If you try to run >java ClassTwo, you will get an error: Main method not found in class ClassTwo, please define the main method as public static void main(String[] args).



2). Now consider same example with litte modification, just declare ClassOne as public.

















public class ClassOne
{
     public static void main(String[] args)
     {
          ClassTwo.methodOfClassTwo();
     }
}
class ClassTwo
{
     static void methodOfClassTwo()
     {
          System.out.println("From Class Two");
     }
}
Naming : The name of above java file must be and only
“ClassOne.java”. You can’t give any other name. If you give any other
name you will get compile time error : class ClassOne is public, should be declared in a file named ClassOne.java.

Compile : Only one name is allowed here so you have to compile with that name i.e >javac ClassOne.java.

Running : That must be >java ClassOne. because this is only class that has main() method.





3). Now make little more modifications to the program. Declare ClassTwo as public and ClassOne as default.



class ClassOne
{
     public static void main(String[] args)
     {
          ClassTwo.methodOfClassTwo();
     }
}
public class ClassTwo
{
     static void methodOfClassTwo()
     {
          System.out.println("From Class Two");
     }
}


Naming : You have to save this file with name as “ClassTwo.java”. If you give any other name you will get compile time error becuase ClassTwo is public.

Compile : It must be >javac ClassTwo.java.

Running : You must name this program as ClassTwo.java, you must compile this program as >javac ClassTwo.java but you have to run it as >java ClassOne not as >java ClassTwo. Because only ClassOne has main() method. ClassTwo doesn’t have main() method. If you run it as >java ClassTwo, you will get run time errorMain method not found in class ClassTwo, please define the main method as public static void main(String[] args).



4). Now make little more modifications to the program. Declare both the classes as public.
















public class ClassOne
{
     public static void main(String[] args)
     {
          ClassTwo.methodOfClassTwo();
     }
}
public class ClassTwo
{
     static void methodOfClassTwo()
     {
          System.out.println("From Class Two");
     }
}


Naming : Whatever you give the name, whether it is ClassOne.java or
ClassTwo.java or anything.java,  you will get compile time error.
Because One java file should contain only one or zero public class. It should not contain more than one public class.



5) Look at the following program.

















class ClassOne
{
     public static void main(String[] args)
     {
          System.out.println("From Class One");
     }
}
class ClassTwo
{
     public static void main(String[] args)
     {
          System.out.println("From Class Two");
     }
}
Naming : You can save this program with any name. It can be ClassOne.java or it can be ClassTwo.java or it can be anything.java as there is no public class.



Compile : You have to compile this program with the name you have given i.e >javac ClassOne.java or >javac ClassTwo.java or >javac anything.java.

Running : Notice that both the classes have main() method. You can run both the classes with their name. i.e  If you trigger >java ClassOne, you will get From Class One as output. If you trigger >java ClassTwo, you will get From Class Two as output.

Saturday 6 June 2015

Changing default directory of CMD

To change default directory of CMD follow these steps:


  • Open CMD and type regedit and press Enter
  • Registry Editor will open. 

  • Navigate to the key HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor from left side. Now Right click on right panel. Select New, then String Value




  • Name it as Autorun

  • Now double click Autorun and type cd /d "New Path" in Value Data textbox. For example if you want that whenever you open CMD the default path will be E:\GSBPROGRAMMING then you will type as: cd /d E:\GSBPROGRAMMING then click OK and close the Registory Editor and also CMD.

  • Now open CMD again and it will open with new default directory everytime

Sunday 31 May 2015

Hide or Display Computer/Recycle bin Icon from desktop


To hide or display the Computer/Recycle bin Icon from desktop follow these steps:

  • Right click anywhere on the desktop
  • Select Personalize

  • In next screen Click on ‘Change desktop icons’.

  • Select the icons that you want to display in your desktop. Checking Computer’ check box will show the my computer icon.

  • Click Ok to save the changes

Thursday 14 May 2015

Blinking Effect by Css



To use above effect just write down the following CSS rules in HEAD section or in external css file :


.blinking{
    animation-name: blinking;   /*  animation name which is attached to .blinking class */
    animation-duration:1s;
      animation-iteration-count:infinite;   /*this effect will run for infinite times*/
      animation-direction: alternate;  

}


@keyframes blinking {
      from {
        opacity:1;
    }

    to {
        opacity:0.7;
    }
}

@-moz-keyframes blinking {
    from {
        opacity:1;
    }

    to {
        opacity:0.7;
    }
}

@-webkit-keyframes blinking {
     from {
        opacity:1;
     }

    to {
        opacity:0.7;
    }
}


After that just assign the class="blinking" to any HTML element to have this effect. To use this in ASP.NET add:

CssClass="blinking"

Note: Sometimes animations not work on Google Chrome, So use Mozilla Firefox

Friday 24 April 2015

How to make a Collapsible panel in ASP.NET using jQuery?


Collapsible Panel is a panel which can collapse. For example, when we click the yellow panel, the another panel below it collapses and when we again click the yellow panel, collapsed panel will become again visible.


To make this type of panel in ASP.NET follow these steps:
  1. After linking jQuery in Head Section, add two panels. Make the backcolor of one panel as yellow.

  2. Now add jQuery Code below the Form Tag. 

When user clicks the panel with ID Panel1, the panel with ID Panel2 with slideToggle with slow speed, i.e. if it was collapsed then it will be shown and vice-versa.

Default syntax of slideToggle is:

$(selector).slideToggle(speed,callback);

where speed can be "slow", "fast", or it can be in milliseconds.

How to use JQuery in ASP.NET?




To use JQuery in ASP.NET follow these steps:

  1. Download JQuery from https://jquery.com/download/ . You can  Download the uncompressed, development jQuery 1.11.2  
  2. Open Visual Studio and Start New Project (ASP.NET Empty Web Application). Give an appropriate name.
  3. Copy the Downloaded JQuery file (jquery-1.11.2.js) to the project by right clicking the project name
  4. Now add an .aspx webform by again Right Clicking the project name->Add-> New Item
  5. Now Link the JQuery file to added webform by using Script Tag
  6. You can also use the JQuery provided by Google's CDN: 
  7. After linking the JQuery to webform, you can use it. But you have write the following code snippet to use the JQuery.

    Here document refers to current document object. This is to prevent any jQuery code from running before the document is finished loading (is ready).
    It is good practice to wait for the document to be fully loaded and ready before working with it. This also allows you to have your JavaScript code before the body of your document, in the head section. 
    Here are some examples of actions that can fail if methods are run before the document is fully loaded:
    • Trying to hide an element that is not created yet
    • Trying to get the size of an image that is not loaded yet
  8. For example to display a Welcome message when document is ready use the following: