Is this a valid WTF javascript?



  • I am not very good with JS so I am not sure wether this code is something special or not.

    Essentially it's a .js file used on one website for their tracking purposes:

    http://sniff.visistat.com/sniff.js

    In particular look at the bottom for strange if expression...

     Thanks!



  • DID is defined in another file, so I can't tell what it's supposed to do.

    It's very filthy JS, though.



  • Did is defined in the page where this js is embeded and is set to:

    <script type="text/javascript">var DID=40074;</script>
     


  • I'd think hope, that this expression is generated by a server-side script. Still very nice of them to let everyone know their customer list.



  • I like how they decided they needed to escape their forward-slashes.

    And that they don’t know about the encodeURIComponent function (or URL encoding in general, apparently), so use a regular expression to replace "&" with "AND" in the recorded referrer string.

    And the browser sniffing for Netscape, that’s always a nice touch. Shows that they keep up well with changes in technology.


Log in to reply