Javascript for loop vs jQuery for each

Javascript for loop vs jQuery for each Web developers often come across looping through data at client side. People generally use native Javascript coding for loop, or jQuery for each. Javascript For Loop. Example var names= ["jkoder", "kumar", "temp"]; var i; var text=""; for (i = 0; i < cars.length; i++) { text += names[i] + ","; } document.write(text); Result-> ... Read More »

Detecting key press for input text and Detecting Enter key

javascript

Detecting keypress for input text and Detecting Enter key The order of events related to the keyup event: 1. keydown – The key is on its way down2. keypress – The key is pressed down3. keyup – The key is released The keyup event occurs when a keyboard key is released. The keyup() method triggers the keyup event, or attaches ... Read More »

Some useful JSP Expression Language hacks in JSP

j2ee

Some useful JSP Expression Language hacks in JSP If you have JSTL in your classpath(by including JSTL.jar and standard.jar in your classpath), then you need to write below taglib directive so that you can use JSTL tags. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%/> 1. Redirecting to other resource in application where, hello.html is another resource. 2. Looping model data in JSP and ... Read More »

Some useful Regular Expression examples

Jkoder.com

Some useful Regular Expression examples Regular expression is a special sequence of characters that helps you match/find strings or sets of strings. Basically it defines a search pattern for strings. They can be used to search, edit, or manipulate text and data. The abbreviation for regular expression is regex Below are some useful regex patterns that can be used in ... Read More »

Consider implementating compareTo and equals method

Java

Consider implementating compareTo and equals method Unlike the other methods the compareTo method is not declared in Object. Rather, it is the sole method in the Comparable interface. It is similar in character to Object’s equals method, except that it permits order comparisons in addition to simple equality comparisons, and it is generic. By implementing Comparable, a class indicates that ... Read More »