Sunday, 18 August 2013

Jquery HTML Tokens replacement

Jquery HTML Tokens replacement

Im looking for the most effective way of creating a client side "HTML
Token" replacement tool. The dea is that a user will add content to a
content editor area on a page. Should they wish to add dynamic content
they will do something like this:
<div>This is my content. Quick Brown fox {{dynamic_token_1}} over the
fence</div>
When jquery fires, itll look up the token and replace it with the correct
content.
Users don't type in HTML so I couldn't do a find all tags. The jquery
would need to iterate to find the "html tokens" (basically html begining
with "{{" and ending with "}}")
Whats the most effective way of doing this?

No comments:

Post a Comment