This question already has an answer here:
I know very well about the classic XSS vulnerabilities such as reflected & stored XSS. I have read a lot about DOM and DOM based XSS vulnerabilities. I came to an inference that there is nothing to do from the server side to prevent DOM based XSS since the attack vectors are never passed to the server side. Then how can we prevent these type of attacks?