i have function linking method javascript library i'm working on. taking romanized korean , converting specific unicode sequences , re-inserting dom. resulting strings generates correct, re-insertion dom seems off...
for example: if have following in dom:
<ko>hangug-eo</ko>
the function meant convert accordingly, replacing hangug-eo
한국어
show on browser:
한국어
within <ko>
tags...
the function string setting within dom follows:
function (){ var z=document.getelementsbytagname('ko'); for(x=z.length;x--;){ z[x].childnodes[0].data=kimchi.go(z[x].childnodes[0].data); } }
however, seems seems doing placing &# unicode entities straight dom without converting respective character equivalents... i'm seeing 한국어
can please point out may doing wrong?
kimchi.go()
function provides unicoded string...
you can set text directly using textcontent
without having use html entities:
z[x].textcontent = '한국어';
but if need use html entities, use innerhtml instead
z[x].innerhtml = kimchi.go(z[x].childnodes[0].data);
you can see latter in example below.
Comments
Post a Comment