JSFiddle - React, Tailwind, and code Playground

by gRoberts

JavaScript

// Proposed Visual Sciences JS Changes.
function vsDoTracking(serverUrl, tmpTracking) {

    var vsUrl,
    vs,
    vsImageString,
    vsObj,
    vsTrackingParameters,
    vsTradeUrl,
    vsTradeBool,
    vsStrProtocol,
    vsCookieVal,
    vsCookieEndStr,
    vsCugSource,
    vsExtraElement;

    if (serverUrl === undefined)
        serverUrl = "";
    
    vsTrackingParameters = new Array();
    vs = new Array();
    vsUrl = window.location.href;

    if (! (window.trackingInfo === undefined)) {
        if (trackingInfo !== null) {
            vs = trackingInfo;
        }
    }
    // If the tmpTracking variable is passed and
    // is not null, use that as the tracking source.
    if (tmpTracking !== undefined && tmpTracking !== null) {
    	vs = tmpTracking;
    }

    try {
        vsExtraElement = (vs.pageidextra === undefined) ? "": vs.pageidextra;
        vs.hostname = document.nav_form.hostname.value;
        vs.protocol = document.nav_form.protocol.value;
        vs.audience = document.nav_form.audience.value;
        vs.pageid = document.nav_form.pageid.value + vsExtraElement;
        vs.logintype = document.nav_form.logintype.value;
        vs.scheme = document.nav_form.scheme.value;
        vs.tier = document.nav_form.tier.value;
        vs.language = document.nav_form.language.value;
        vs.country = document.nav_form.country.value;
    } catch(e) {}

    if (! (window.vsHardCodedName === undefined)) {
        if (window.vsHardCodedName !== null) {
            vsIndex = vsHardCodedName.lastIndexOf("/");
            vs.hardcodedname = vsHardCodedName.substring(vsIndex + 1, vsHardCodedName.length);
        }
    }

    try {
        vs.dt = document.title;
        vs.dr = document.referrer;
        vs.cb = new Date().getTime();
        vs.sw = screen.width;
        vs.sh = screen.height;
        vs.cd = screen.colorDepth;
    } catch(e) {}

    if ((vsUrl.indexOf("?") > -1) && (vsUrl.indexOf("?") != (vsUrl.length - 1))) {
        vs =...