jQuery sanitizing comments and linkifying URLs

Posted by iWasRobbed on Stack Overflow See other posts from Stack Overflow or by iWasRobbed
Published on 2011-02-10T22:46:52Z Indexed on 2011/02/10 23:25 UTC
Read the original article Hit count: 188

Filed under:
|
|
|
|

In terms of jQuery (or Javascript), what happens behind the scenes when a person posts a comment on Facebook, Twitter, or a blog?

For instance, do they sanitize the text first, and then pattern match URL's into an actual link? Are there other items of concern that the client-side should check in addition to doing some checks on the backend?

I have found a few regex's for turning URL's into links, but I'm not sure if there are better solutions.

I'm trying to wrap my head around the problem, but I'm having a difficult time knowing where to start. Any guidance you can provide is greatly appreciated!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery