Tuesday, January 20, 2009

Javascript converting XML Document to XML String

We can do it easily using XML Document object to load XML String to form an XML Document.
But, to do it the other way, there isn't a direct method  like .OuterXML in Javascript.

All along I've been using like this for my AJAX application

if (xmlDoc.xml!=undefined)   xmlContent = xmlDoc.xml; else   xmlContent = xmlDoc;

While it appears to be working when I send the xmlContent over the AJAX POST Call, recently there had been some error. It appears that webkit based browser like Safari and Chrome do not escape the special characters in the XMLTextNode while IE and Firefox do.

The solution is simple:

function XMLToString(oXML) {   if (window.ActiveXObject) {     return oXML.xml;   } else {     return (new XMLSerializer()).serializeToString(oXML);   } }

regards,
choongseng

Friday, January 16, 2009

4GB Supported in Windows Vista 32-bit SP1


Another reason for you guys to upgrade to Vista if you haven't so. With Windows Vista Service Pack 1, now you can see the full 4GB RAM in your system even if you are running only 32bits version of the Operating System.

Yes, too good to be true, same as most other people out there, I'm excited and happy to have 4GB shown in my laptop, only for the few minutes.


Oh microsoft, I hate it!

Well, RAM is dirt cheap nowadays that I've just upgraded my laptop from 2GB (2 x 1GB sticks) to 4GB (2 x 2GB sticks), and that cost S$60. The prices started to go up somehow, I was told by the shopkeeper that 4 hours ago it was S$28 per 2GB stick.... :-S 

And ofcourse, I bought the Kingston, very cheap RAM.

regards,
choongseng