JavaScript Links
  • Updated on 06 May 2020
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

JavaScript Links

  • Print
  • Share
  • Dark
    Light

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 Parameter Value
DCS.dcssip hostname
DCS.dcsuri href
WT.ti "JavaScript:" + title
WT.dl 22
WT.nv Enclosing element id or classname (if present)
Was this article helpful?