CancelImage Upload

Topics: JavaScript
Read our latest entries.
Posted by Garren Harland on November 11, 2009, 11:57 am.
Previously I have discussed how a JavaScript function can be called upon via an anchor tag. The same principles of course are also applicable to HTML buttons, images, and other HTML elements.
Click here to read on.
Posted by Garren Harland on September 30, 2009, 2:22 pm.
Unlike PHP, where a variable can be called upon at any time without being previously initiated, JavaScript requires that a variable has been defined properly before it can be used.
Click here to read on.
Posted by Garren Harland on September 30, 2009, 10:39 am.
In a previous tutorial I have discussed how a numeric array can be sorted with the elements being ordered from the smallest to largest value in JavaScript. However, what if we wanted to turn things around, and sort the numbers in the order from largest to smallest?
Click here to read on.
Posted by Garren Harland on September 30, 2009, 10:17 am.
If you want to load a specific section out of an array in JavaScript, here is the function that you are looking for. Its name is slice, and it does just that, returning a specified slice of an array. The key of course is its definition.
Click here to read on.
Posted by Garren Harland on September 29, 2009, 10:35 am.
Sparse as JavaScript array functions may be, there is one available to reverse the order of the array. It's name, no surprise, is reverse(), and here is how it is defined.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 6:58 pm.
To join two arrays in JavaScript the function concat() is required. This function needs to be placed at the end of the first array, with the second array contained inside it's brackets. Here is how it is implemented.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 6:05 pm.
As previously discussed, all that is required in order to sort an array in JavaScript is to define the function sort(), after the array that requires putting in order. However, a bit of trickery is required to indeed sort a numeric array according to it's numeric values.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 5:34 pm.
Quite often when dealing with arrays the need arises to sort them alphabetically. In JavaScript this is accomplished via the function sort(), which can be called upon at the end of an array object.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 3:37 pm.
Changing the float property dynamically is another one of those annoying instances where browser manufacturers could not agree with each other. While Netscape decided that the property should be accessed via cssFloat
Click here to read on.
Posted by Garren Harland on September 28, 2009, 3:00 pm.
The standard HTML form submit button is all well and good. But as soon as you start working on more complex web applications you will probably sooner, rather than later, require a JavaScript function via which a specified form can be submitted. Here then is just that function.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 2:48 pm.
Reset buttons are not the only method available by which form fields can be reset. Indeed the simple JavaScript command reset() can be called upon from numerous elements including anchor tags and onClick images. Here is the code that needs to be placed within these element's onClick or href attributes.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 1:05 pm.
Although maybe not as object orientated as other programming languages, JavaScript does allow you to initiate and make use of your very own object. To do this all that you require is a simple function. In our example we will use a function called newUser(), where new users can be added and initiated.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 12:03 pm.
When developing an interactive web application with a windows like user interface you may need to know when a mouse button has been pressed, and when it has, which one.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 11:28 am.
If you are developing a web application, and require the service of some special keyboard combinations, you may wish to bring the Alt key into play. Here then is a tutorial on how the Alt key signal can be detected with JavaScript.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 11:00 am.
As a frequent user of various IT applications you are no doubt familiar with shortcut keys. And while these are common among stand alone applications they are rarely useful or necessary on individual websites. This however, may not apply for your web applications, such as intranets, and other client orientated programs.
Click here to read on.
Posted by Garren Harland on September 28, 2009, 9:35 am.
If you are programming a fancy typing interface for your web application you will without a doubt need to find out when a user has actually pressed the shift key. It's the only way after all for your application to then decide when to type small or large letters.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 6:46 pm.
While the event onkeyup detects the instance when a user presses a key, by itself we will not know which key has been pressed. For this we will need to consult the event object to find out the Unicode of the key in question. Here is the code with which this task can be accomplished.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 6:21 pm.
Every day the demand on web applications increases, requiring them to look and feel more and more like a windows desktop environment. Achieving these effects requires the use of JavaScript event functions.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 5:29 pm.
Returning to the last place a user has visited is easy with JavaScript. All that is required is the windows history object, and the function back().
Click here to read on.
Posted by Garren Harland on September 27, 2009, 5:11 pm.
In JavaScript there are two types of scroll functions. One is scrollTo, which takes a user to a specified set of page coordinates. The other is scrollBy(), which is far more handy for dynamic web pages where the scrollTo coordinates might have changed.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 4:47 pm.
The following code should only be applied to target blank or pop-up windows, since it requires that the window has not already taken up 100% of the page's width and height. However, if this isn't the case, the following function can be very useful indeed if you require a smaller window to be placed in a very specific location.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 4:33 pm.
Usually the code discussed on this page would be applied to a page that was opened via a target blank anchor tag. Indeed, resizing a normal browser window (instead of a "pop-up" window), may cause your website visitors a certain level of concern.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 1:17 pm.
To focus on, or blur the curser from a form element in JavaScript is simple. All that you need is the following two functions.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 12:22 pm.
Embedding a Java Applet is a pretty straight forward task. However, there is no point embedding an Applet if the browsers Java Component has been disabled. Here then is the JavaScript code to find out whether or not this has been the case. Note that we are talking about Java Applets here, not JavaScript. If JavaScript has been disabled you need to make use of noscript tags.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 12:01 pm.
Ever wanted to know how many of your visitors actually use Mac or Windows? Are you curious as to what percentage have actually ventured on to Linux? Then you will be interested in the code discussed on this page.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 11:46 am.
If your website makes use of cookies, you will no doubt need to find out if your visitor has actually still got them enabled on their browser. If they have you can carry on with business as usual. If not however you may want to go down a different path in order to prevent script errors.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 11:20 am.
If you want to get to know your website's visitors a bit better, you may want to find out what language's their browsers are in. Alternatively you may even want to adjust the language that your website is displayed in based on the browser language.
Click here to read on.
Posted by Garren Harland on September 27, 2009, 10:57 am.
In order for your website to become a success you may need a good idea about where your user is coming from. With the following JavaScript code you will easily find out what the last destination was, and how they came to you. A great method therefore for showing who's linking to you.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 7:12 pm.
If you are working on a multi domain platform you may need to find out through which name the website is being accessed. In JavaScript this task can be accomplished via the following code.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 5:43 pm.
Accessing the HTML title object via JavaScript and DOM is not really a task of great difficulty. All that is needed is the correct path. Since this path consists of two words it would really take a grand master in failure to get this wrong;-):
Click here to read on.
Posted by Garren Harland on September 25, 2009, 5:17 pm.
I have frequently discussed how the JavaScript function getElementById() can be used to access an individual HTML tag, and manipulate it's content, styles and properties. And while this function more than fulfils the requirements for accessing an individual HTML element, what if we wanted to access a specific set of tags, let's say every span tag within our document?
Click here to read on.
Posted by Garren Harland on September 25, 2009, 1:03 pm.
To load the a browser's current location via JavaScript the following code is required. Simply specify the document object, and request the extension URL.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 10:30 am.
If you have a page that calls for functionalities within a pop-up you may need to check to make sure that it is indeed still open, and that the user has not closed it. Here is how the pop-up's status can be checked via JavaScript.
Click here to read on.
Posted by Garren Harland on September 25, 2009, 10:00 am.
Thanks to JavaScript's timeout function various fade in, and other effects can be created, that look similar to those found within Flash Programs. Here then is how the JavaScript function setInterval() can be set.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 8:20 pm.
To find out the available width and height of a users screen, taking away the space taken up by the Operating System's taskbar, the following JavaScript code can be used.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 7:27 pm.
To find out what the bit depth of a visitors screen is using JavaScript you will need to use the following code.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 6:54 pm.
Note that this tutorial discusses how a user's screen dimensions height and width can be established via JavaScript. This is not to be confused with the browser's current height and width, but the actual computer screen through which the website is viewed. Depending on this setting you may choose to make layout changes to your HTML document, to suit screens with greater or smaller width.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 6:32 pm.
As you are no doubt aware, JavaScript does things slightly different to other programming languages. In JavaScript then, instead of inserting a regular expression into a bracket, along with the variable to be validated, we actually load the regular expression into a variable, and test the variable to be validated against the regular expression using the function test.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 5:16 pm.
Joining array elements in JavaScript, is while slightly different to most programming languages, not that difficult. Indeed, all that needs to be done is specify the function join at the end of the array variable, and defining what characters the individual array elements should be joined together with.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 5:01 pm.
You would think JavaScript would already have a pre-built in shuffle function. Something along the lines of the PHP function shuffle(). Well, unfortunately JavaScript does not posses such a function. Meaning it is up to us as programmers to create it ourselves.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 3:14 pm.
Producing random numbers in JavaScript is a rather complicated process, when compared to most programming languages, such as PHP, where only a simple rand() definition is required to return a random number.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 2:42 pm.
To calculate the square route of a number in JavaScript, we need to use it's Math Object. By adding the square route extension (sqrt) and specifying the number inside the brackets, we can calculate the square route.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 2:20 pm.
If you are in need of PI within your JavaScript code, and do not feel like having to enter the exact number every time you require it's services, you need not worry. Here's is an easy way of accessing it.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 1:33 pm.
If you are a programmer with experience, yet new to JavaScript, you will no doubt sooner or later be looking for a size of array function, equivalent to the function sizeof() in PHP. In JavaScript this information is returned using the following code.
Click here to read on.
Posted by Garren Harland on September 23, 2009, 1:15 pm.
If you are new to programming this article will introduce you to the advantage of arrays over standard variables. While for experienced programmers this guide merely serves as a reference in regard to how arrays are defined in JavaScript.
Click here to read on.
Posted by Garren Harland on September 22, 2009, 7:37 pm.
On a dynamic website you may want to enable your users the ability of deciding for them selves whether or not background images should be repeated vertically, horizontally, both, or not at all. Here then is a quick tutorial on how to accomplish this task for the body property.
Click here to read on.
Posted by Garren Harland on September 22, 2009, 7:06 pm.
JavaScript may not be the most difficult programming language to learn, yet it is one of the most annoying due to different browsers having their own interpretations of various sets of code, and some do not even include functions which others do.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 7:22 pm.
Previously I have discussed how the CSS Opacity property can be accessed via JavaScript, and how it can be used to fade an image on mouseover. This page then will discuss how a slow image fade-in effect can be achieved by adding a bit more code to the standard opacity changing JavaScript functions.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 5:29 pm.
In order to disable and enable textareas the disable/enable property needs to be set, unset within the form element. Here is how this goal can be achieved using JavaScript and the getElementById() function.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 4:36 pm.
Inserting line breaks into a textarea with JavaScript is not as bigger operation as it may sound. In essence a line break inside a textarea is defined as \n. There is no need to insert BR tags or the like.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 4:03 pm.
Let's face it, if there is one thing the internet was built for, it is countdown clocks. Countdown until the NBA season starts, countdowns until a movie is released and of course countdowns until the end of the world are ever popular examples.
Click here to read on.
Posted by Garren Harland on September 16, 2009, 2:54 pm.
As far as programming in JavaScript goes, there are few simpler commands than the one used to call upon the browser's printer.
Click here to read on.
Posted by Garren Harland on September 6, 2009, 9:41 pm.
To insert bold, italic, underline or any other HTML tags into a selected range within a textarea we need to first of all establish what area has been highlighted. In JavaScript we can access this property through the following path:
Click here to read on.
Posted by Garren Harland on September 5, 2009, 12:44 pm.
Validating a phone number is easy. That is if you merely want to make sure that the user has indeed entered a number, and not used any alphanumeric letters.
Click here to read on.
Posted by Garren Harland on August 30, 2009, 8:47 pm.
The following page discusses how regular expressions can be used to validate the British National Insurance Number, which is allocated to ever UK resident within the United Kingdome upon their 16th birthday. This number is usually received in a card format, containing a 9 digit code, consisting of the following format, 2 letters, 6 numbers and then to finish another letter.
Click here to read on.
Posted by Garren Harland on August 29, 2009, 6:56 pm.
There are two ways to call upon a JavaScript function via a HTML link tag. The first is to simply set the onClick property available in most HTML element.
Click here to read on.
Posted by Garren Harland on August 29, 2009, 11:22 am.
When defining a JavaScript Confirm Message Box an action needs to be defined for each reply. This is accomplished by creating a variable through which JavaScript can tell which response was chosen.
Click here to read on.
Posted by Garren Harland on August 28, 2009, 7:09 pm.
Encoding data to be sent via AJAX can turn into a nightmare in some languages. Usually encoding the data with the JavaScript function encodeURIComponent() and decoding it with a function such as PHP's rawurldecode() will prove enough to send and receive data the other end via AJAX. However, this is not always the case. Recently I had a Russian client who needed a guestbook. And although the AJAX worked fine in sending Latin characters, and even managed to post German and French letters such as ä, ë, ö and ö, the Russian characters were misinterpreted.
Click here to read on.
Posted by Garren Harland on August 28, 2009, 4:33 pm.
To retrieve an individual character's ASCII value the function charCodeAt() can be used, which is the JavaScript equivalent of the PHP function ord().
Click here to read on.
Posted by Garren Harland on August 22, 2009, 12:38 pm.
Sending special characters such as plus symbols through an AJAX form to be received the other end requires a bit of trickery. Often when programmers experience trouble with this kind of transmissions there was either...
Click here to read on.
Posted by Garren Harland on August 17, 2009, 11:13 am.
Previously I have discussed how various cursor styles can be accessed via CSS. This current tutorial will go one step further, and give an insight how the cursor property can be changed to another setting dynamically once the page has already been loaded.
Click here to read on.
Posted by Garren Harland on August 7, 2009, 6:03 pm.
Having problems with your JavaScript drop down menus not being able to appear over Flash files? Don't worry, you are not alone. Luckily there is a pretty easy solution to the problem, simply set the flash file to transparent.
Click here to read on.
Posted by Garren Harland on August 5, 2009, 12:59 pm.
Accessing the value of a HTML select box via getElementById() does not work the same way on all browsers. While the traditional getElementById value will work on Internet Explorer, Opera, and most other browsers, Netscape will not be able to interpret it and will break off the script mid function.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 2:22 pm.
In Latvia Postcodes consist of two letters followed by a hyphen and four digits.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 1:56 pm.
Japan's postcodes consist of 7 digits, grouped into 3 and 4 digit cluster separated by a hyphen. Here for instance is what Chiyoda in Tokyo's Postcode looks like.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 6:31 pm.
Brazil has a nationwide scheme known as Codigo de Enderecamento Postal (CEP), which has been running since 1972 and consists of 5 digits. Thanks to economic groth however a three digit suffix has been added to the CEP since 1992. This gives Brazilian Postcodes the following format.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 3:07 pm.
To validate a South African Postcode we need to devise a Regular Expression that validates numbers from the range of 0001-9999. For elegance sake I will split the following example into two parts. First to check that the user has not entered 0000, and then to validate that indeed four digits have been entered. Here are the two regular expressions we will use.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 1:15 pm.
China's Postal codes consist of 6 digit number system which is applicable for the whole country. Since the lowest range belonging to Taiwan (000000???009999) can consist of six zeroes (although the lowest code in this regard probably has five zeroes: 000001), the resulting regular expression code is not very long. In fact all that needs to be done, is the specification that six ({}) digits ([0-9]) are required.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 11:51 am.
Indian postal index numbers are 6 digit numbers, and therefore putting together a Regular Expressions statement to validate them does not require to much work. Our statement will consist of two parts, the first consisisting of numbers ranging from 1-9, the second, consisting of 5 digits will be 0-9.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 10:59 am.
While the code below uses JavaScript to demonstrate a HTML Color Code validation, the regular expression itself should work in a variety of programming languages, including server side languages such as PHP.
Click here to read on.
Posted by Garren Harland on July 29, 2009, 9:17 am.
Because New Zealand Postcodes are a simple 4 digit number their validation is very simple, as the following regular expressions goes to show. Note that the regular expression itself should be usable by a number a programming languages! Here is what it looks like.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 7:45 pm.
If you have recently come across the CSS visibility property you are no doubt asking yourself how to utilise it. After all, a hidden element, be it a div, span or table, is only useful if at some point you can change it's status from hidden to visible. Lucky for us web developers there is this language called JavaScript which can help us change such settings on the role.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 5:01 pm.
While putting together the following script I for the first time could appreciate what it must have been like inventing the nuclear bomb. Nothing good could come from it, but for curiosity sake, and because of the need to prove oneself the needles creation carried on being built into existence.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 3:23 pm.
People in general are not very smart when it comes to inventing passwords. It is shocking how many of us actually believe using a family members' name, date of birth, wedding date, wife or pet's name, favourite sports team, etc are secure choices!
Click here to read on.
Posted by Garren Harland on July 28, 2009, 12:36 pm.
This is a rather elegant solution for crowded websites with not much space. Particularly to place "Enter your comment here:" in front of a textarea, or "Enter Username:" before a textbox.
Click here to read on.
Posted by Garren Harland on July 28, 2009, 11:51 am.
The effect of an image changing on mouseover can, when used moderately, turn a stylish but boring website, into a stylish interactive website. The keyword here is moderation. Don't disorientate your visitors with 1000 image dynamic image changes per page.
Click here to read on.
Posted by Garren Harland on July 25, 2009, 4:42 pm.
The general practice of using pop-ups as an integral part of dynamic websites has become vastly outdated in recent years. Yes, if you want to open up a new window to display another site, popups are the one and only method to use.
Click here to read on.
Posted by Garren Harland on July 24, 2009, 3:25 pm.
Although JavaScript can be used to output the local time settings of a browser, it is hardly an accurate tool for displaying the time of various time zones. Indeed, even to work them out in JavaScript you will need to use mathematical calculations, that (taking Summer and Winter times into account) often come up with questionable results.
Click here to read on.
Posted by Garren Harland on July 24, 2009, 2:13 pm.
The JavaScript Clock that we are about to discuss will display the current time that your computer is set to. And while this method is ideal for accessing a user's local time, there are a few issues that need to be considered.
Click here to read on.
Posted by Garren Harland on July 22, 2009, 11:34 am.
If the function getElementById() is new to you I would suggest you read the introduction tutorial first before you attempt the following task. It could save you some debugging later on.
Click here to read on.
Posted by Garren Harland on July 22, 2009, 10:34 am.
GetElementById()'s talents are seemingly endless. While I have already discussed how this function can be used to change CSS Font Families, they can also be used to set style properties such as height, weight and font style. Here is how we can access these three properties.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 7:17 pm.
As I have previously written, the JavaScript Function getElementById() provides the possibility of accessing various span and div elements through their ID attributes, and to change their properties. Naturally enough these properties include CSS Font Families.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 5:59 pm.
While rounding numbers up and down to even values is pretty straight forward in JavaScript, rounding them to a specific decimal point requires a bit of trickery. Nothing complex though. You don't have to be a maths genius to figure this one out. First of let us have a look at the code used to round numbers up (or down) to even values in JavaScript.
Click here to read on.
Posted by Garren Harland on July 16, 2009, 11:05 am.
If you are receiving the Invalid Argument message in your JavaScript Error List it could be caused through one of the following.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 7:05 pm.
Date of birth inputs come in various shapes and sizes. To fit these various requirements I have put together 6 different Regular Expressions for the various styles. I am sure if there is not one there to fit your required criteria you can mix and match to come up with the desired result!
Click here to read on.
Posted by Garren Harland on July 11, 2009, 5:38 pm.
Are you tired of having to type [a-zA-Z0-9] every time you want your regular expressions to look for alphanumeric symbols? Then you are not alone! Thankfully an alternative method exists to address various shapes and forms of symbols in regular expressions.
Click here to read on.
Posted by Garren Harland on July 11, 2009, 2:48 pm.
First of all, to change the height and width properties of a table or div element with getElementById() you will need to ensure that each of the HTML tags that you plan on becoming dynamic, have a unique ID attribute. The importance of this is highlighted in the example at the bottom of the page, where id1 is the defined ID for the example table, and id2 for the Div.
Click here to read on.
Posted by Garren Harland on July 11, 2009, 1:08 pm.
Do you want to change font colors of div, span and table elements using JavaScript? Then here is the code that you have been looking for.
Click here to read on.
Posted by Garren Harland on July 10, 2009, 4:35 pm.
One of the easiest ways to change a HTML element's background property is using JavaScript's getElementById() function. As previously discussed in other tutorials getElementById() accesses individual HTML tags by their defined ID tags, and through doing so allows various properties to be changed via JavaScript.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 8:01 pm.
I have previously discussed how to change the content of span or div tags by using getElementById and innerHTML. As you might be aware, getElementById() can do far more than just change content. Indeed it can access and manipulate a tag's style components. This tutorial will specifically focus on how you can manipulate borders by using JavaScript.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 6:41 pm.
Ever asked yourself why html elements have ID tags? You might be aware that they can be used to style an element with CSS, but using Classes makes far more sense most of the time. Especially since ID tags cannot be duplicated under any circumstances. But why not? Well, here is (at least one reason) why ID tags have to remain unique.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 2:50 pm.
To change any element within a HTML document using JavaScript we need the element's correct path. Here is how we can access input fields using JavaScript.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 2:09 pm.
A good JavaScript popup statement consists of the following three components.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 1:12 pm.
So you want to close a popup with JavaScript? Then you are about to embark on one of the most challenging quests of your programming career. Or not. As far as programming goes it does not get much more simple and straightforward than this.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 12:42 pm.
As mentioned in a previous tutorial parent window and their elements can be accessed with window.opener. Here then is a more in depth view into some of the possibilities provided by this code.
Click here to read on.
Posted by Garren Harland on July 8, 2009, 10:56 am.
The JavaScript code to access parent windows elements is not a complex one. Indeed, all that is needed is the code window.opener. The rest of the element can be addressed as per usual.
Click here to read on.
Posted by Garren Harland on July 7, 2009, 7:23 pm.
There are two ways to build a regular expression to validate Australian Post Codes. There is the easy way which will check that at least the format is right, and then there is the hard way to make sure the postcode entered is within the correct postcode range following the state abbreviation code.
Click here to read on.
Posted by Garren Harland on July 7, 2009, 12:51 pm.
Since US Zip Codes consist of numeric values they are pretty simple to validate with regular expressions. What is important is that the Zip + 4 format is taken into account.
Click here to read on.
Posted by Garren Harland on July 7, 2009, 12:03 pm.
Here is a tutorial for those of you wishing to validate SWIFT and BIC Codes using JavaScript by using Regular Expressions. I have already written a similar tutorial on how to validate SWIFT and BIC Codes in PHP, and for a detailed explanation of what components the code consists of I suggest your read the intro section of that tutorial first.
Click here to read on.
Posted by Garren Harland on July 6, 2009, 3:51 pm.
Need to validate your website users' UK Postcodes? Here's how it is done using regular expressions in JavaScript. When constructing regular expressions it is always important to remember that they compare strings from left to right. So in this case, we want AA99 to be tested before AA9.
Click here to read on.
Posted by Garren Harland on July 4, 2009, 6:51 pm.
Do you want your users to automatically scroll to the same location after a page reload? Then here is one of the solutions you have been looking for. Most modern websites now employ Ajax where there is really no need for a page reload/auto scroll, but I guess the need for this function could still be found. Plus the code below shows you how to automatically scroll to specific location within your page.
Click here to read on.
Posted by Garren Harland on July 3, 2009, 12:50 pm.
As the title indicates, this tutorial will teach you how to validate a website URL using JavaScript. This method has a few advantages over validating a website URL using PHP, as the validation process takes place within the browser, meaning no server request or reload is necessary.
Click here to read on.
Posted by Garren Harland on July 2, 2009, 7:07 pm.
Since you are reading this article I will assume that you already know what AJAX is and how it works. You are probably either planning to build a website using AJAX, or have already built a site and are curious as to why your pages are not being indexed in Google.
Click here to read on.
Posted by Garren Harland on July 2, 2009, 11:43 pm.
As the title indicates, this tutorial will teach you how to validate an email address using JavaScript. This method has a few advantages over validating an email address using PHP, as the validation process takes place within the browser, meaning no server request or reload is necessary.
Click here to read on.
myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com