Banned inline style CSP and dynamic positioning of HTML elements

后端 未结 2 1771
忘了有多久
忘了有多久 2020-12-09 07:17

A client has changed their CSP to ban inline styles on their server. As far as I can tell, this means that we can no longer use JS to dynamically position/animate/style HTML

2条回答
  •  情书的邮戳
    2020-12-09 07:40

    JavaScript is executed on the client. Unless the filtering software is incredibly clever, you can still add dynamic inline styles as the server has no idea what's happening in the browser. What you can't do, however, is add inline styles as part of the HTML you send to the client.

提交回复
热议问题