jquery callback()

As we know that JavaScript statements are executed line by line. But, if the effects are applied, the next line of code can be run even before the finishing of the current effect which can create errors. For this reason, we use callback functions. A callback function is executed after finishing of the current effect... Continue Reading →

jquery animate()

Among several effects, there also exists animation in jquery. Yes, we can also animate a jquery element such as a div or button using the animate() method. Syntax $(selector).animate({params},speed,callback); Params is the required parameter and it defines the CSS properties to be animated. properties may include left,right, opacity and many others Speed and callback are... Continue Reading →

jquery .each()

.each() iterates for each matched element. Syntax $(selector).each(function(index,element)) For example, in the following piece of code, on the click of button, text of each list item will be displayed jquery Example $("button").click(function(){ $("li").each(function(){ alert($(this).text()) }); });

Function to reverse a Number in C#

C# Code using System; namespace ReverseNumber { class Program { static void Main(string[] args) { Console.WriteLine("Enter a Number to reverse"); int Number = int.Parse(Console.ReadLine()); int Reverse = 0; while(Number>0) { int remainder = Number % 10; Reverse = (Reverse * 10) + remainder; Number = Number / 10; } Console.WriteLine("Reverse No. is {0}",Reverse); Console.ReadLine(); }... Continue Reading →

Function to reverse a string in C#

C# Code using System; namespace reverseString { class Program { static void Main(string[] args) { string strng = "", reverse = ""; int Length = 0; Console.WriteLine("Please Enter a Word"); strng = Console.ReadLine(); Length = strng.Length - 1; while(Length>=0) { reverse = reverse + strng[Length]; Length--; } Console.WriteLine("Reversed word is {0}",reverse); Console.ReadLine(); } } }

Reference vs Pointer

Differences POINTERREFERENCEIs a variable that holds memory address of another variable. // int *ptr = &i; Is an alias i.e. another name for an already existing variable. // int &ref = i; Can point nowhere e.g. NULLMust refer to an objectCan be re-assigned any number of times Cannot be re-assigned after binding Can take the... Continue Reading →

Function to validate email in javascript

This regular expression will not verify if the particular email id exists or not. Instead, this regex is to validate the format of email id In jquery var ValidateEmail= function (email) { var regexp = new RegExp('^[^\s@]+@[^\s@]+\.[^\s@]+$'); var check = $(email).val(); if (!regexp.test(check)) { alert('Invalid e-mail!Please enter the e-mail ID in correct format'); $('#EmailID').css('border-color', 'red');... Continue Reading →

Chaining in jQuery

Using jQuery, We can chain together actions/methods as it allows us to run multiple jQuery methods/actions on the same element using just a single statement. We can chain the methods together using a period or dot(.) The advantage of chaining is that browsers don't have to find the same element more than once. Example $("#div5").css("color",... Continue Reading →

Fading in jQuery

There are four main fading effects in jQuery that can be applied to the HTML elements. They can be applied using these 4 methods: fadeIn() //to fade in a hidden element fadeOut() //to fade out a visible element fadeToggle() // toggles between fadeOut() and fadeIn() fadeTo() //fading to a given opacity (value between 0 and... Continue Reading →

Blog at WordPress.com.

Up ↑

Create your website at WordPress.com
Get started