I have a webpage for example www.testing.example.com/home, now if someone manually add script tag onto the url bar like www.testing.example.com/home/<Script>alert('asd')</script> then it should not give alert, it should redirect to 404 page.
I want to say if my url has script tag then it should redirect to 404 page apart form giving the alert message.
How can this be achieved using Javascript?
1 Answer