Archive for the ‘javascript’ Category

Date manipulation is a common programming task a developer does regularly and many times can get tricky and cumbersome. If youy web applications relies heavily on date manipulation on the frontend than moment.js is the library you have been looking for. In short this is what you can do with moment.js moment("20111031", "YYYYMMDD").fromNow(); // 2 [...]

The Web Speech Synthesis API allows your web apps to convert page text or any other predefined or dynamic text to be rendered to speech. Although currently supported only in Chrome 33, the api enables you to add nice accessibility support to your web apps. However, I’m hard-pressed to find a suitable application for the [...]

Being primarily a developer, designing a web page is not my forte. I usually design web pages using notepad++ and a browser. Although I use grid support, many times I just wish for a simple overlay guide which I can use to layout the different web components. Recently I found one with RulersGuides.js.

In the last post we saw how we could easily work with mouse events on an iPad. Touchscreen devices like the iPad do not have a cursor, so the user cannot exactly move the mouse over an HTML element triggering a ‘mouseover’ event. One of the readers requested on how we could use a different [...]

Because of the way Safari on iOS creates events to emulate a mouse, some of your web page elements may not behave as expected on iOS. In particular, some elements that only use mouseover handlers need to be changed because iOS doesn’t recognize them as clickable elements, such as the div below. As the image-container [...]

Single Page Applications (SPA) are on the rise and with it various JavaScript frameworks. A decade back the notion of developing whole web applications in javascript would have sounded ludicrous. But now things are different. We now have many complex frameworks that enable you to easily develop web applications using nothing but JavaScript, even on [...]

X-editable is a library which allows you to create editable elements on your page. It can be used with bootstrap, jquery-ui, jquery and jQuery and includes both popup and inline modes. This library is not supposed to be used in place of a standard form, but in places where in-place editing is required, such as [...]

One of the first steps in validating form data is with JavaScript. And with JavaScript disabled you are open to possible invalid input data. Of course everyone further validates the form data on the server, but that entails a round trip if errors are encountered. In many situations it is just better to prevent any [...]

Email is one of the common input fields in any web form. Many sites use two email fields to make sure that the user has entered correct email ids. This is a common idiom in web design, and it is surprising that it has not changed over all these years. One of the interesting alternative [...]

One of this year’s most interesting open source projects has been PhantomJS – a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG. I’ve already used it to automatically scrape data from pages and for testing. In this post we will [...]