Building an iPhone/Android Web App Using the Sliding-Pane Component

In today’s blog, I’m going to show how I used the Sliding-Pane to create a fairly complete iPhone application.   You can download the code here. Background In November, I created a UI component called Sliding-Pane that creates a sliding-type animation on a specific div. The idea came from OSX’s …

How to Get the Name of an Instance of a Class in Javascript

I was using JSONP (note that I prefer CORS but this was a special case where CORS wasn’t possible) and wanted an object that needed to call a method within itself. As you know, JSONP involves adding a script tag to the DOM which will return the JSON data encapsulated …

Asterisk PBX, Google Voice and an Old Buffalo TeraStation NAS

Compiling Asterisk came to be a little bit of a bother. The main issue is that you’re dealing with a fairly old NAS so some of the shared libraries may not be compatible.  I had an old Buffalo TeraStation (Model #HD-H0.6TGL/R5) laying around that I was trying to figure out …

How to Wrap an Element Within a New Element Using Javascript

Here’s a simple way of wrapping an HTML fragment that exists in the DOM within another element, in this case a div: var wrapper = document.createElement(‘div’); wrapper.id = ‘the-wrapper’; wrapper.appendChild(document.querySelector(‘#the-html-fragment’)); At this point, the HTML fragment that was selected via the #the-html-fragment selector was removed from the DOM and attached …

How to Get the Current Script’s Parent in Javascript

The following is a method of getting the current script’s parent, which may be useful if, for example, you need to append HTML in the same location as the script: var scripts = document.getElementsByTagName(‘script’); parent = scripts[scripts.length – 1].parentNode; The above code maintains the assumption that the currently executing script …