How to allow users to write javascript with security?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Blogs providers such as Tumblr and Blogger allow users to write scripts in their own blogs. It makes users add AdSense, Analytics and counters into their blogs easily. How to keep security and customization both? What kind of scripts should I filter? Thx :) 回答1: If every blog is going to be on its own domain (not a shared second level domain like blogname.myblog.com !), chances are there is no need to filter anything at all. The Same Origin Policy will prevent sites from having access to anything important (like session cookies that could be