Difference between JavaScript and jQuery ? Javascript is the mother of JQuery. JavaScript is a language. JavaScript library designed to simplify the client-side scripting of HTML Javascript is the script that you could perform form validation, submission, animation and effects. JQuery is a library and part of javascript with Ajax. jQuery is a framework built with JavaScript to help JavaScript programmers.
Posts
Showing posts from June, 2016
- Get link
- X
- Other Apps
What are Pseudo-Elements? A CSS pseudo-element is used to style specified parts of an element. For example, Style the first letter, or line, of an element Insert content before, or after, the content of an element Syntax selector::pseudo-element { property : value ; } Difference between ::first-line versus :first-line The double colon replaced the single-colon notation for pseudo-elements in CSS3. The single-colon syntax was used for both pseudo-classes and pseudo-elements in CSS2 and CSS1. The ::first-line Pseudo-element The ::first-line pseudo-element is used to add a special style to the first line of a text. Note: The ::first-line pseu...
- Get link
- X
- Other Apps
What are CSS3 Animations? An animation lets an element gradually change from one style to another. You can change as many CSS properties you want, as many times you want. To use CSS3 animation, you must first specify some @ keyframes for the animation. @Keyframes hold what styles the element will have at certain times. The Building Blocks of Animations CSS3 animations are made up of two basic building blocks. Keyframes - define the stages and styles of the animation. Animation Properties - assign the @keyframes to a specific CSS3 element and define how it is animated. The @keyframes Keyframes are the foundation of CSS animations.They define what the animation looks like at each stage of the animation timeline. Each @keyframes is composed of: 1. Name of the animation: A name that describes the animation, for example, bounceInRight . 2. Stages of the animation: Each stage of the animation is repres...
- Get link
- X
- Other Apps
HTML/DOM events for JavaScript Events Description onclick occurs when element is clicked. ondblclick occurs when element is double-clicked. onfocus occurs when an element gets focus such as button, input, textarea etc. onblur occurs when form looses the focus from an element. onsubmit occurs when form is submitted. onmouseover occurs when mouse is moved over an element. onmouseout occurs when mouse is moved out from an element (after moved over). onmousedown occurs when mouse button is pressed over an element. onmouseup occurs when mouse is released from an element (after mouse is pressed). onload occurs when document, object or frameset is loaded. onunload occurs when body or frameset is unloaded. onscroll occurs when document is scrolled. onresized occurs when document is resized. onreset occurs when form is reset. onkeydown occurs when key is being pressed. onkeypress occurs when user presses the key. onkeyup occurs when key is released.
- Get link
- X
- Other Apps
JavaScript String The String global object is a constructor for strings, or a sequence of characters. There are 2 ways to create string in JavaScript By string literal By string object (using new keyword) 1) By string literal The string literal is created using double quotes. The syntax of creating string using string literal is given below: 2) By string object (using new keyword) The syntax of creating string object using new keyword is given below: var stringname = new String("string literal"); JavaScript String Methods Let's see the list of JavaScript string methods with examples. charAt(index) he JavaScript String charAt() method returns the character at the given index. var str = "javascript" ; document.write(str.charAt(2)); concat(str) The JavaScript String concat(str) method concatenates or joins two strings. var s1 = "javascript " ; var s2 = "concat...
- Get link
- X
- Other Apps
How can we detect OS of the client machine using JavaScript? The navigator.appVersion string can be used to detect the operating system on the client machine. What is the difference between undefined value and null value? Undefined value: A value that is not defined and has no keyword is known as undefined value. For example: int number;//Here, number has undefined value. Null value: A value that is explicitly specified by the keyword "null" is known as null value. For example: String str = null ;//Here, str has a null value. Difference between Client side JavaScript and Server side JavaScript? Client side JavaScript comprises the basic language and predefined objects which are relevant to running java script in a browser. The client side JavaScript is embedded directly by in the HTML pages. This script is interpreted by the browser at run time. Serve...
- Get link
- X
- Other Apps
What is JavaScript? JavaScript is a scripting language . It is different from Java language. It is object-based, lightweight and cross platform. It is widely used for client side validation. Where JavaScript is used Client-side validation Dynamic drop-down menus Displaying data and time Displaying popup windows and dialog boxes (like alert dialog box, confirm dialog box and prompt dialog box) Displaying clocks etc.
- Get link
- X
- Other Apps
About JavaScript JavaScript is an Object Oriented Programming (OOP) language. A programming language can be called object-oriented if it provides four basic capabilities to developers − Encapsulation − the capability to store related information, whether data or methods, together in an object. Aggregation − the capability to store one object inside another object. Inheritance − the capability of a class to rely upon another class (or number of classes) for some of its properties and methods. Polymorphism − the capability to write one function or method that works in a variety of different ways.
- Get link
- X
- Other Apps
Arithmetic Operators + (Addition) - (Subtraction) * (Multiplication) / (Division) % (Modulus) ++ (Increment) -- (Decrement) Note − Addition operator (+) works for Numeric as well as Strings. e.g. "a" + 10 will give "a10". Comparison Operators = = (Equal) != (Not Equal) > (Greater than) < (Less than) >= (Greater than or Equal to) <= (Less than or Equal to ) Logical Operators && (Logical AND) || (Logical OR) ! (Logical NOT) Bitwise Operators & (Bitwise AND) | (BitWise OR) ^ (Bitwise XOR) ~ (Bitwise Not) << (Left Shift) >> (Right Shift) >>> (Right shift with Zero) Assignment Operators = (Simple Assignment ) += (Add and Assignment) −= (Subtract and Assignment) *= (Multiply and Assignment) /= (Divide and Assignment) %= (Modules and Assignment) Note − Same logic applies to Bitwise operators so they will become lik...
- Get link
- X
- Other Apps
What is an operator? An operator is an object that is capable of manipulating a value. For example, in "1 + 2", the "1" and "2" are the operands and the plus symbol is the operator. JavaScript supports the following types of operators. Arithmetic Operators Comparision Operators Logical (or Relational) Operators Assignment Operators Conditional (or ternary) Operators
- Get link
- X
- Other Apps
JavaScript Reserved Word abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends false final finally float for function goto if implements import in instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with
- Get link
- X
- Other Apps
JavaScript Array Methods Converting Arrays to Strings The JavaScript method toString() converts an array to a string of (comma separated) array values. The join() method also joins all array elements into a string. Popping and Pushing Popping items out of an array, or pushing items into an array. pop() method removes the last element. push() method adds a new element to an array (at the end). Shifting Elements shift() method removes the first array element and "shifts" all other elements to a lower index. unshift() method adds a new element to an array (at the beginning), and "unshifts" older elements. The shift() method returns the string that was "shifted out". The unshift() method returns the new array length. Splicing an Array splice() method can be used to add new items to an array: Example : var fruits = [ "Banana" , "Orange" , ...
- Get link
- X
- Other Apps
JavaScript Arrays What is an Array? Arrays are used to store multiple values in a single variable. Array hold many values under a single name, and you can access the values by referring to an index number. [0] is the first element in an array. [1] is the second. Array indexes start with 0. Syntax: var array-name = [ item1 , item2 , ...]; Array Properties length Property The length property of an array returns the length of an array (the number of array elements). Adding Array Elements The easiest way to add a new element to an array is using the push method. New element can also be added to an array using the length property: Loop Array An array, is using a "for" loop: Associative Arrays Many programming languages support arrays with named indexes. JavaScript does not support arrays with named indexes. In JavaScript, arrays always use numbered indexes . ...