Interactive Website Framework, or IWF, is essentially a wrapper for much of the mundane javascripting associated with creating highly interactive, browser independent, responsive websites. It keeps much of the "traditional" website coding paradigm, while introducing several new functionalities -- such as being able to suppress a page from entering the browser history (good for preventing data duplication when a user reposts the last request)
topYes, but very minimally. For instance, if you understand what the following anchor tag does, you'll be able to use IWF effectively:
<a href='javascript:alert("Hello!")'>Say Hi</a>A common example of something relatively complex that IWF boils down to a simple function call is AJAX. AJAX is a term for the browser sending a request to the server without clearing the current page.
listcds.php
page which returns
HTML representing a list of cds and you want to put that HTML into an element with
the id of "putCdsHere":
<a href='javascript:iwfRequest("listcds.php", "putCdsHere");'>List Cds</a>All the details of creating the XmlHttpRequest object, setting its properties, asynchronously calling the server in the background, catching the response upon completion, parsing that response, finding the appropriate element on the page, and injecting the HTML is done for you. The only thing you need to do is tell IWF what you want and where to put it. Simple, right? top
IWF contains a multitude of helper functions and objects, broken into 4 main categories:
Consists primarily of:
iwfToDate
)iwfIsString
)iwfGetById
, iwfAppendChild
)iwfHtmlEncode
, iwfXmlDecode
)iwfFloatFormat
)
Consists of three objects, iwfXmlDoc
, iwfXmlNode
, and iwfXmlWriter
. These objects
can be used to parse and create xml. These are not a reimplementation of the DOM objects -- these are
designed to have more readable javascript code. For example, let's say we have the following xml:
<internet> <site url='www.sourceforge.net'> <description>Great place for open source projects!</description> </site> <site url='iwf.sourceforge.net'> <description>IWF Project Home</description> </site> </internet>To pull the description for the IWF site using the typical DOM:
var desc = doc.documentElement.lastChild().firstChild().innerText;To pull the same node using the custom IWF implementation:
var desc = doc.internet.site[1].description[0].getText();Reference for IWF XML
This contains functions to affect the user interface. Ability to change the following aspects are included:
iwfShow
, iwfHideGently
)iwfX1
, iwfMoveTo
)iwfZIndex
)iwfHeight
, iwfWidth
)iwfOpacity
)iwfEvent
)This contains code required to perform AJAX requests. Reference for IWF AJAX
I have chosen the Lesser GPL (or LGPL) to license the IWF. I wanted this code to be free and in the wild, but I thought the GPL was overkill for this type of library-like code.
top