Mercurial > eldonilo > blog
comparison atom.js @ 8:461a24a5a788
Silent errors when testing if we are server- or client-side.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 02 Nov 2011 09:48:28 -0700 |
parents | 7ab6b48122af |
children | 360186772aa3 |
comparison
equal
deleted
inserted
replaced
7:7ab6b48122af | 8:461a24a5a788 |
---|---|
1 'use strict'; | 1 'use strict'; |
2 | |
3 if (!document) | |
4 var document = {}; | |
5 | |
6 if (!document.createElementNS) | |
7 document.createElementNS = function(ns, name) { | |
8 return new Element(name, {xmlns: ns}); | |
9 }; | |
10 | |
11 if (!document.createTextNode) | |
12 document.createTextNode = function(text) { | |
13 return text; | |
14 }; | |
2 | 15 |
3 parsers[ns.atom] = function(id, xml) { | 16 parsers[ns.atom] = function(id, xml) { |
4 var toDate = function(atom) { | 17 var toDate = function(atom) { |
5 if (!atom) | 18 if (!atom) |
6 return new Date; | 19 return new Date; |