All pastes #418499 Raw Edit

NIckwiz

public javascript v1 · immutable
#418499 ·published 2007-03-31 17:26 UTC
rendered paste body
function _createElement(type,parent){    var el = null;    if(typeof document.createElementNS!='undefined'){        el=document.createElementNS("http://www.w3.org/1999/xhtml", type);    }else if(typeof document.createElement!='undefined'){        el=document.createElement(type);    }else{        return false;    }    if(typeof parent!="undefined"){        parent.appendChild(el);    }    return el;}var obj_tmp = _createElement('span');obj_tmp.innerHTML = 'test & space   end';var str_fixt=obj_tmp.textContent.replace(/&/,'&');