开发者

Tags in HTML attributes?

I have a plugin that enable users to add on a cap开发者_如何学Ction to a image if they want to, using the title attribute. I would like to find out, if I allow them to do this :

<img title="I am a <myplugin-a>caption</myplugin-a>" src="imagelink" />

and then in my js, I would do a replace for "myplugin-".

Would this lead to any problems in terms of validation?


It wouldn't lead to validity problems (less then and greater than characters are allowed as data in title attributes), but it would mean your HTML would be nonsensical if the JS wasn't applied (users may have JS disabled, a JS file may fail to load, a search engine indexer usually won't execute any JS, etc).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜