Support » Plugin: Slimstat Analytics » Uncaught TypeError: all_links[n].href.indexOf

  • Resolved snaphappyme

    (@snaphappyme)


    Hi,

    I have an embedded SVG image with hotspot hyperlinks.

    As Slimstat adds tracking to hyperlinks within the page; I think this javascript error relates to Slimstat’s attempt to add tracking to links to the SVG tag’s hotspots.

    Which is reasonable to expect. But SVG objects are a little more complex and the CSS class/id hierarchy is more complex so I think it is struggling.

    The error on developer console is:

    Uncaught TypeError: all_links[n].href.indexOf is not a function
        at Object.attach_tracker (wp-slimstat.min.js:1)
        at wp-slimstat.min.js:1

    The SVG markup has links defined like this (snippet below):

    <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="71px" height="59px" viewBox="0 0 71 59" enable-background="new 0 0 71 59" xml:space="preserve">
    <g id="RATE">
    	<a id="rate1" xlink:href="gohome.htm" >
    	<g>
    		<path id="f_3_" fill="#BE1E2D" d="M12.312,36.646c-0.848,2.59-1.439,5.266-1.75,7.996l2.859-0.079c0.896-1.69,1.912-3.32,3.038-4.884C14.829,38.484,13.391,37.433,12.312,36.646z"/>
    		<path id="e_3_" fill="#191E64" d="M10.123,45.025l0.048-0.423c0.311-2.72,0.904-5.434,1.766-8.066l0.168-0.511l0.446,0.326c1.079,0.786,2.517,1.839,4.148,3.034l0.292,0.215l-0.208,0.29c-1.113,1.546-2.126,3.172-3.01,4.839l-0.105,0.197L10.123,45.025z M12.522,37.269c-0.715,2.289-1.227,4.636-1.521,6.989l2.176-0.061c0.82-1.521,1.742-3.013,2.75-4.436C14.631,38.811,13.467,37.958,12.522,37.269z"/>
    	</g>
    	</a>
    </g>
    </svg>

    Thanks

    • This topic was modified 1 year, 1 month ago by snaphappyme. Reason: typo fix
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Uncaught TypeError: all_links[n].href.indexOf’ is closed to new replies.