Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Saturday, 19 May 2012

Geolocation in HTML5

HTML5 has added plenty of resources that enhances the web browsing experience of its users. As a web developer, the point to note is that implementing these features on your site is much easier compared to what it has to offer. In this post, I will introduce you to Geolocation, a feature with which you can obtain the position in coordinates of a user.

Tuesday, 15 May 2012

Introduction to AJAX

AJAX stands for Asynchronous JavaScript And XML and is a technique used by web developers to make their web sites fast and dynamic. The advantage of using AJAX is that you can update a part of your webpage without reloading the whole page. That is you can send and receive data to and from a server without refreshing  the page. This enables you to minimize data transfer and hence improve performance. Now in this post, lets see how to start using AJAX on your web application.

Wednesday, 9 May 2012

Create JSON from MySQL To use with AJAX

Now a days most websites use the power of AJAX to make their website more lively and productive. To transfer large amount of raw data, that JavaScript can process, the best way is to transfer it as a JSON file. It is quite easy for a PHP script to generate a JSON file from raw data. This data can be received using a suitable AJAX call. As JavaScript can easy parse JSON object, the rest of the processing with the received data can be done using JavaScript.

Saturday, 28 April 2012

Get Selected Text From a Text Box Using JavaScript

There are times when you need to process the selected text from long text inside a text area or a text box. This can be easily implemented in JavaScript. The starting index and ending index of the selection can be obtained using "selectionStart" and "selectionEnd". The JavaScript function implementation using this is shown in this post.

Guide to Good Programming Habits

From a novice programmer to a veteran, there are a few rules to be followed so that the code you write has a professionalism in it. These might be simple things like adding comments or using proper variable names, but following it in a systematic way will make your code more easy to develop, test, debug and deploy. These rules are applicable to any programming language and making it a habit will help you in the long run. In this post, I will explain a few rules that could be followed.

Thursday, 12 April 2012

Validation - Client or Server Side

Whenever data is transferred from a client to the server, it is extremely important to validate the data so as to ensure the secure and successful completion of the process. The question lies with whether the validation has to be done in the server alone or in both server and client side. Which one will be the better and efficient choice. Obviously validation in the client side alone is not at all an option because it can be easily bypassed.

Friday, 6 April 2012

Password Strength Indication Using JavaScript

It is a good practice to indicate the strength of the passwords that the users of your website choose so that they can make a secure choice. You can make a password strength indication for your website using JavaScript. A simple JavaScript function to accomplish this is discussed below. It gives a visual indication of the strength using a progress bar and also a textual description.

Progress Bar Using JavaScript

A simple progress bar can be created using JavaScript and HTML which shows graphically the percentage of work completed along with numeric indication. A user defined JavaScript function prog_bar is used here.

On - Screen Number Pad Using JavaScript

It would be quite interesting if you provide an option to enter numbers using an on-screen number pad in your website. Since most of the new mobile devices doesn't  come with a separate number pad, it is difficult to enter numbers fast. So providing an on-screen number pad would be a good alternative.
Here I have described a simple on-screen number pad developed using CSS, HTML and JavaScript.

Monday, 31 October 2011

Count Number Of Characters in a Textarea Using JavaScript

Ever wanted to create a cool textarea or a text box that counts the number of characters in it just as in Twitter or some other sites. It is much easier to built one for your own site than you might have expected. With a simple javascript function, you can count the number of characters as you type and display it.
If you have a basic understanding in HTML and JavaScript, you could make one in a couple of minutes.
Here is a simple version of the complete code along with the required HTML tags.