Another way of writing less-than

In one of my projects, I had to check the version number of included JavaScript library to detect out-of-date browser cache. However, that's hard if you generate web pages with XSLT transformations. Finally, this trick worked for me - instead of writing
if (window.libraryVersion > minimumVersion) ...
... I wrote ...
if (Math.max(window.libraryVersion,minimumVersion) ==  minimumVersion) ...

No comments:

Post a Comment