Javascript Journal

Pravin’s Javascript Blog

Funtime ! Classic 15-Puzzle

This weekend I spent sometime writing Flex/Flash Based Game.

This is a classic 15-puzzle, I call it as Slide.

To play you first scramble the tiles and then try to put them back in order.
To move a tile you simply click on it. The only tiles you can move are those adjacent to the hole.

To play in separate window, click here

Unable to enable JavaScript in IE8

If you’re having a problem in your browser with JavaScript, you may
want to re-register the jscript.dll file. This can be done by executing the

Start > Run…
In the Run box, type in (without quotes) “regsvr32 jscript.dll”
You should receive a popup says that it registration succeeded.

You then should be able to display JavaScript in your browser properly.

In general for you are having problem running Javascript and VBScript, at command prompt in DOS window do followings:

cd windows\system32
regsvr32 /u jscript.dll
regsvr32 /u vbscript.dll
regsvr32 jscript.dll
regsvr32 vbcript.dll

Javascript, SVG: draw

This is a simple drawing pad build using javascript. Currently works for IE only.

Here is a link to drawing pad

For IE, you have to install SVG Viewer.

HTML: Area map

This was one of my very old work.

This shows, how one can use Image area map with different shapes.
See the code in action

See in action

Please feel free to view and use the code for you application.

Show/Hide Code

Flex 3: PHP: Email Application

This a working demo of Flex / PHP Email application.

live demo! Flex 3 Email Application

Backend is PHP.

It is easily customizable. If you like to have a source code of this, please let me know.

Flex 3: Online Presenter Tool

With a push for Learning Management System (LMS), I decided to write my own version of online presenter using Flex 3 and XML technologies.

Here is Demo for you.

Here is Another Demo for you.

This presentation can easily customized for any needs (such as LMS,Show-n-tell, picture gallery, movie gallery, etc.) and
powered by XML configuration file.

Also check out the Flex 3 Image gallery application

Show/Hide XML Config File

Javascript: Cutting Speed Calculator

Because of my mechanical engineering (in particular CNC programming) background, I had written this application.

I believe this a handy application.

Cutting Speed Feed Calculator

Suggestions, if any, please let me know.

Javascript: OO Graph Library

This graph class was developed by me long back.

Here is example code

Like to see the graph class

If you like to use it , please go ahead.

<SCRIPT LANGUAGE="JavaScript1.2">
    var g = new Graph(800,400);
    g.addRow(22, 55, 47,103,21, 62,  5, 7, 69,3,33, 7, 74, 121, 58, 5, 46,11);
    g.addRow(54,556,213,260,73,171,134,30,380,4, 9,18,200,500,301,13,440,15);
    g.scale = 100;
    g.title = "PCR Status as on MM/DD/YYYY";
    g.yLabel = "Count";
    g.xLabel = "Module Name";
    g.setXScaleValues ("Assembly", "CAM", "Display", "Drafting", "File Manager",
                       "GUI", "History", "Mold Design", "Other", "Other2D",
                       "Other3D", "Sheet Metal", "Sketcher",
                       "Solid Oprns", "Surface Oprns",
                       "Tools", "Translators", "Wireframe");
    g.setLegend ("Enchancements", "Bugs", "Total");
    g.stacked = true;;

Javascript: Captcha

Here is a captcha validation, using Javascript.

Generates Random Sequence.
Validate at client side.

Test Captcha Page

Google Map 1: Simple

Last Friday someone asked me, Have you programmed Google Maps ? Can you do this ?

Sure !

Here is a my simple application.

  1. You need to sign-up with Google to Get Key
  2. Read Google’s GMap2 (currently V3 API). If you know Javascript and OO programming, it is fairly easy to follow.
  3. Create HTML forms, and your javascript functions