javascript - How to get HTML code compatibility for old / modern browsers -


i using material icons font, angularjs, cordova android/ios app.

problem is, android 4.x versions, have use "old" way display icon, (code documentation) :

<!-- modern browsers. --> <i class="material-icons">arrow_back</i> <!-- ie9 or below. --> <i class="material-icons">&#xe5c4;</i> 

so now, think have find every icons in project, , update icon text hexa one, before have questions :

questions :

  • is safe (or bad practice) only use old way (&#xe5c4;) display icons, modern browsers ? compatibility dropped in few years modern browsers ?
  • is there way (in angularjs, pure js or html, if possible) detect if browser dosen't support modern way, , then, replace icon text hexa (arrow_back -> &#xe5c4;)

when use hexadecimal solution, works, pain when read html, have found other solution : generate icons via classname.

it works great, created repository if had same problem : material-icons-css


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -