How To: Animate background color change with jQuery

Posted by SteveHardie | On: Aug 04 2013 | Comments (2)
This article will show briefly guide you through how to smoothly animate a background color change using jQuery. jQuery Version: 1.9.1 jQuery UI: 1.10.3 First, make sure you have linked to both jQuery and jQueryUI. Put this code in you <head> section of...

Javascript: Formatting Numbers

Posted by SteveHardie | On: Feb 03 2011 | Comments (0)
When rounding decimals, there are some built-in javascript functions that can help you with the basics var num = 10; var result = num.toFixed(2); // result will equal 10.00 num = 930.9805; result = num.toFixed(3); // result will equal 930.981 num = 500.2349; result...

JavaScript: Add an Image Rotator to your Web Site

Posted by SteveHardie | On: Oct 07 2010 | Comments (0)
Here is a quick and simple way to add a fading image rotator to your website, using CSS and JavaScript You’ll need to download the OM4 Simple Image Rotator javascript and stylesheet before you can use this. Click Here to view a sample.

Javascript: How to use ASP.NET Forms Validation from Javascript

Posted by SteveHardie | On: Jun 24 2010 | Comments (1)
ASP.NET has a Page.Validate() method that is used to programatically validate an ASP.NET Form, however, Page.Validate() is a server side function and requires a postback. Its job is to run server side validation. So to run client-side validation, without causing...

Javascript: Popup Windows

Posted by SteveHardie | On: Mar 03 2010 | Comments (0)
This post shows you how to create a basic popup window using Java Script as well as a reference list of options for popups. JavaScript allows you to open new windows from within your HTML code. You can even have actions in one window effect another window.

Javascript: Adding an element to HTML Document

Posted by SteveHardie | On: Nov 13 2009 | Comments (0)
Create and append a HTML element dynamically using javascript. var divTag = document.createElement("div"); divTag.id = "divID"; divTag.setAttribute("align","center"); divTag.style.margin = "0px auto"; divTag.className ="dynamicDiv";...

Javascript: Scroll window to an anchor tag or any element

Posted by SteveHardie | On: Oct 31 2009 | Comments (1)
You may want to direct the browser view to a particular part of your page, either when the page is loaded, or as part of a seperate javascript routine. Below is a simple, 1 line JavaScript code that will programatically scroll the browser window to an anchor tag,...

What is the JavaScript equivalents for Chr() and Asc()

Posted by SteveHardie | On: Sep 18 2009 | Comments (0)
Use:  String.fromCharCode(charCode) e.g: var str1=String.fromCharCode(65) will return “A” charCodeAt(index) returns the char code for the character at a given index position within a string (zero based index). So if you want the char code for a single...

Allow Only Numbers in Textbox

Posted by SteveHardie | On: Sep 18 2009 | Comments (0)
Sometimes we need the user to enter only numbers in a text field, so I have found a small piece of JavaScript that does that. function onlyNumbers(evt){     var e = event || evt; // for trans-browser compatibility     var charCode = e.which || e.keyCode;...

Character Code List (Char Code)

Posted by SteveHardie | On: Sep 10 2009 | Comments Off on Character Code List (Char Code)
ASCII and HTML code table # Symbol HTML Code | # Symbol HTML Code 32 [Space] &#32; | 143 &#143; 33 ! &#33; | 144 &#144; 34 " &#34; | 145 ' &#145; 35 # &#35; | 146 ' &#146; 36 $ &#36; |...