dipanshu February 2016

Script for changing numbers giving error

<script type="text/javascript">
    var adiInit = "xxxx",
        adiRVO = true;
    var adiFunc = null;
    (function () {
        var adiSrc = document.createElement("script");
        adiSrc.type = "text/javascript";
        adiSrc.async = true;
        adiSrc.src = ("https:" == document.location.protocol ? "https://static-ssl" : "http://static-cdn") + ".responsetap.com/static/scripts/rTapTrack.min.js";
        var s = document.getElementById("script")[0];
        s.parentNode.insertBefore(adiSrc, s);
    })();
</script>

On add in footer variable s is coming null. so giving error in all browsers and phone numbers are not changing.

http://prntscr.com/a0k1vt

How can i resolve it . Please need fix asap

Answers


vtz February 2016

Try with the below instead of var s = document.getElementById("script")[0];

var s = document.getElementsByTagName("script")[0];

Post Status

Asked in February 2016
Viewed 1,005 times
Voted 12
Answered 1 times

Search




Leave an answer