Sunday, August 3, 2008

JavaScript to Generate Data


JavaScript is a pretty powerful scripting language. Tied in to DHTML it provides a means of dynamically controlling a page. The control can result in something that could almost be called an application.

Having found that PHP had limitations for generating data, I decided to work on a version under JavaScript. I can't say that it's totally complete - doesn't do numbers, dates, or fixed length strings with a fill character - but it was some fun to complete.

Another good reason to use JavaScript, is that it can be used to both in an active web page, and as a standalone tool (through a browser) with little need to actually make any modifications. The supporting tools add extra value - JSMin to reduce the web version of the library and JSLint to verify that the code is correct.

While this tool works for its limited string options, there are number of opportunities for improvement. Even a little code prettifying would be good - let alone separating into object components for reusability.

Zemanta Pixie

No comments: