Reputation: 8245
I've just found out about the contenteditable
attribute and I was thinking about practical uses for it.
I think it would be awesome for quick updates to a page, but there are some concerns such as:
I love this idea of quickly editing the page's content right where you're going to see it. I'm pretty excited about implementing such a thing on my website, but I could use a bit of guidance before attempting it.
Can anyone address the above listed issues as well as anything I haven't considered that might be pertinent?
Thanks for your time!
Upvotes: 3
Views: 1885
Reputation: 2439
A use case is fonts website promotion.
I discovered this attribute on https://www.luciole-vision.com/luciole-en.html#try where you can change text and see your text with this font.
Upvotes: 0
Reputation: 75707
contenteditable
itself. People can change the content of any page on the internet right now using the browser's development tools but, other than faking funny screenshots, it's not much use to them if the server doesn't accept updates. The more important issue here is protecting against things like cross-site scripting attacks by making sure the content the user adds to the page is 'safe' (this, for example, is why blogs typically disallow most HTML tags in comments).contenteditable
attribute in the server side logic after the user has logged in. Alternatively, add it with JavaScript when the user clicks an 'Edit' button. I wouldn't expect it to change the whole page's markup because for this approach to be sensible the pages would already be getting generated at the server side anyway from a template being filled with content stored in a database. If you're talking about making a static site editable then, yes, you'd have a lot of work to do, but you'd have that work to do however you planned on letting people edit the pages.Upvotes: 3