First, if you have not discovered XSnippets at OpenNTF.org, go there! No wait! Go after reading the rest of this post!
Second, for some of my apps I prefer server-side validation but I still need to put something right in front of the user’s nose in case the form does not validate so I like a client-side JavaScript alert. Problem is connecting it nicely with the server-side validation failures.
Bam! The new 8.5.3 view.postScript() method totally fits the bill.