I have a problem with a site I'm developing in which I have a US map with each state as a polygon defined in an svg. Each of those polygons is wrapped in a link so users can click on a state to be taken to information about that state.
Code layout:
<svg...>
<a xlink:href="...">
<polygon ...><title>{stateName}</title></polygon>
</a>
</svg>
The problem I'm having is when someone clicks one of these links I get several errors:
TypeError: this.href.match is not a function in googleanalytics.js line 36, col 66
...rupal.settings.googleanalytics.trackOutbound && this.href.match(/^\w+:///i))
TypeError: target.protocol is undefined in overlay-parent.js line 575
if (href != undefined && href != '' && target.protocol.match(/^https?:/)) {
After some experimentation I narrowed it down to those functions having undefined events.
The googleanalytics.js function is:
...
$(document.body).bind("mousedown keyup touchstart", function(event) {
...
The overlay-parent.js function is:
...
Drupal.overlay.eventhandlerOverrideLink = function (event) {
...
I assume this has something to do with the links being nested in the svg for some reason but I can't find any good information on why or how to get around that.
I tried using a jquery.svg.js plugin but that had no impact.
Using: Drupal 7.34 jQuery 1.10.2 (via ajax.googleapis.com) Google Analytics 7.x-2.1 (googleanalytics.js) jQuery Update 7.x-2.4 (replace/misc/1.9/overlay-parent.js)
If any other info is needed to help figure this out let me know.
Thanks in advance for any help you can provide!