Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当然这是可能的,如果变量包含例如'></a><script>alert(1);</script>. 所以无论如何你都需要清理它的价值。
'></a><script>alert(1);</script>
不,你不能。使其工作的最简单方法是将函数调用直接放在元素之后
<body> <a></a> <script>alert(1)</script> </bodY>