Skip to main content

Posts

Showing posts from 2008

Converting Javascript XML Object to String

I recently ran through a problem of XMLSerializer object. This is not working with IE. Fortunately IE support this simple method to convert an XML Objet to a String."XMLObject.xml". The following function will convert an XML Object in both browsers. function xmlToString(xmlObj) { if (navigator.appName == "Netscape") { return (new XMLSerializer()).serializeToString(xmlObj); } if (navigator.appName == "Microsoft Internet Explorer") { return xmlObj.xml; } }

Projecting HTML Elements on a circle using Javascript

Recently I wonted to create a tree control with a different approach. The requirement was to represent a node tree with main node on the circle center and it's child nodes projected on a circle around it. This is what i wanted. My solution has 5 files prototype.js This is a handy javascript framework. You can download the latest version from there website ( www.prototypejs.org/download ). I am using this to simply handle the onload event in the page. circle.html script.js node-main-left.gif node-sub-left.gif The circle.html, prototype.js and the script.js files are in the root folder and the two images are inside a folder named “images”. This is how the html file looks(circle.html). <html> <head> <script src="prototype.js" type="text/javascript"></script> <script src="script.js" type="text/javascript"></script> <script language="javascript" xml:space

How to design a website - layout using free tools

There are many web development tools available on the market. Some of them ships with basic features and some contains very advanced features. What if you are unable to use any commercial tool available and still you want to design a pretty complex design, slice it, and convert it to html/css. How do I know this? I know this since once I ran in to this situation by myself. What I did first was to download Inkscape , which is a free vector graphic program. Creating a design in Inkscape is same as other vector graphic applications. But unfortunately there is no straight forward way of slicing the design and exporting. This is what I did as a workaround. I simply add a new layer to the project and named it as “slicing”. I made sure to keep the “slicing” layer above from the rest of the layers and locked all the other layers below it. I drew a rectangle surrounding the area I wanted to export. If the rectangle has stroke or fill it was critical to disable them since I wanted to export onl