elq is not defined error in javascript

1.5k views Asked by At

I am trying to run the following javascript function. While running the below script, firebug spots an error. Below is the error message,

ReferenceError: elq is not defined elq.dynamic(-57770, 5000, 'replace-me');

Code:

<div id="replace-me"> </div>    


<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', '5000']);
_elqQ.push(['elqTrackPageView']);

(function () {
    function async_load() {
        var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true;
        s.src = '//img.en25.com/i/elqCfg.min.js';
        var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
    }
    if (window.addEventListener) window.addEventListener('DOMContentLoaded', async_load, false);
    else if (window.attachEvent) window.attachEvent('onload', async_load); 
})();
</script>


<script type="text/javascript" src="http://img.en25.com/i/elqDyn.min.js">
</script>

<script type="text/javascript">
elq.dynamic(-57770, 5000, 'replace-me');
</script>
1

There are 1 answers

0
hm_ngr On

this pdf (page 4) says like this

<script type="text/javascript">
var _elqQ = _elqQ || [];
_elqQ.push(['elqSetSiteId', 'siteId']);
_elqQ.push(['elqTrackPageView']);
(function() {
function
async_load() {
var s = document.createElement('script'); s.type = 'text/javascript'; 
s.async = true; 
s.src = '//img.en25.com/i/elqCfg.min.js';
var x = document.getElementsByTagName('script')[0]; 
x.parentNode.insertBefore(s, x);
}
if (window.addEventListener) window.addEventListener('DOMContentLoaded', async_load, false);
else if (window.attachEvent) window.attachEvent('onload', async_load); })();
</script>


<script type="text/javascript" src="http://img.en25.com/i/elqDyn.min.js">
</script>

<!-- your code -->
<script type="text/javascript">
elq.dynamic(-57770, 5000, 'replace-me');
</script>