JavaScript Links
  • 06 May 2020
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

JavaScript Links

  • Dark
    Light
  • PDF

Article summary

JavaScript links are hyperlinks whose URL contains the following protocol (scheme): "javascript:".

If enabled, an event handler function is added for all links that have the JavaScript protocol.

Using JavaScript links

<a href="javascript:alert('Good Morning')">Alert Greeting</a>

Clicking the link generates the following parameters:

DCS.dcsuri=javascript:alert('Good%20Morning') WT.ti=JavaScript:Alert Greeting WT.dl=22

JavaScript Example:

window.webtrendsAsyncInit = function () {
        var dcs = new Webtrends.dcs();
        dcs.init( {
                dcsid: "dcs12345610000wocrvqy1nqm_123p", 
                javascript : true
        });
        dcs.track();
        }


JavaScript Reference:

dcsMultiTrack ParameterValue
DCS.dcssiphostname
DCS.dcsurihref
WT.ti"JavaScript:" + title
WT.dl22
WT.nvEnclosing element id or classname (if present)

Was this article helpful?

What's Next