Home » Javascript & Libraries

Someone wanted the code written in VBScript, which would fetch the content of a webpage, grab the html table with a specific identifier from it, and print all the text in its cells. This script loads an instance of Internet Explorer in the background and asks it to load a webpage. We can then grab any DOM element on the page using Document.getElementById()....
While coding, many of us want to see a JSON string printed right in the browser in a readable format for easy debugging. In PHP, I usually convert the JSON string back to an Array and use print_r to print the array which throws readable output in the view-source mode. In some cases we really want to print the JSON string formatted. Use the below methods. I....
We call it Short Circuit Evaluation (also known as minimal evaluation, or McCarthy evaluation) when a programming language DOES NOT evaluate/execute the second operand in a condition. if the first operand alone can fully determine the outcome of that condition. We have been using this concept in our codes always. All PHP guys must be familiar with this...
The world is slowly adopting HTML5 and it is time to move towards it. HTML5 incorporates many features which were achievable only using third party plug-ins. I am not talking about HTML5 in detail. I just want to give you some light on a great feature which HTML5 ships with, “Canvas”! “Canvas” which is an HTML5 tag, allows you...
A very basic tutorial. For the beginners who want to pass array values from PHP to Javascript for them to be accessible in the client side JS as an array. It’s really easy to pass PHP array to Javascript. The below code passes a string array in PHP to Javascript. <?php $arr = array("a","b","c"); ?> <script> var...
Do you think your website is sluggish? Does it take a lot of time to download on to a user computer? Here are some techniques to make your site load faster on user computers and enhance it’s performance. These are some of the best practices followed in the Web industry. Implementing these practices has proved that your site will become 20-30%...
This tutorial teaches you to easily apply Zebra styling to your static/dynamic tables. The method of styling alternate rows with different colors is also known as Zebra styling. We normally achieve this by defining two sets of styles for odd and even rows of a table and manually adding these class names in to the table rows. When the data table is generated...
When a form is submitted to the server, only selected values in a multiple SELECT box reaches the server. It is not possible to access the unselected options in a SELECT box from the server. Though this is not really required always, there are situations where you would want to access all the options in a SELECT tag. One example is, when you allow users...
This article basically talks about two things. 1) A Javascript code to move options from one multiple select box to another in a form. Move options from one SELECT box to another: There are two multiple SELECT boxes and one has got some OPTIONS in it. User can select one or more options from one and click on the Move button to transfer the selected...

Page optimized by WP Minify WordPress Plugin