html - Find and separate links in JavaScript string -


i making windows 8 app html + js , have field user can input data, when revisit page set <div> equal input. possible may input url want convert link. every example has read talks enclosing in tag when write text div use "div.innertext" rather "div.innerhtml" in case user wrote incorrect html data causes app crash.

is there anyway can fail safe against user entering incorrect html , still have hyperlinks in text?

you need escape user data first, replace urls links , use innerhtml property write data element


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -