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

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -