Code Duplication    Length = 18-18 lines in 2 locations

libs/js/recaptcha.js 1 location

@@ 17-34 (lines=18) @@
14
    var script = document.createElement("script");
15
    script.type = "text/javascript";
16
17
    if (script.readyState) {
18
      //IE
19
      script.onreadystatechange = function () {
20
        if (script.readyState == "loaded" || script.readyState == "complete") {
21
          script.onreadystatechange = null;
22
          if (typeof callback == "function") {
23
            callback();
24
          }
25
        }
26
      };
27
    } else {
28
      //Others
29
      script.onload = function () {
30
        if (typeof callback == "function") {
31
          callback();
32
        }
33
      };
34
    }
35
36
    script.src = url;
37
    document.getElementsByTagName("head")[0].appendChild(script);

libs/js/utility.js 1 location

@@ 203-220 (lines=18) @@
200
  var script = document.createElement("script");
201
  script.type = "text/javascript";
202
203
  if (script.readyState) {
204
    //IE
205
    script.onreadystatechange = function () {
206
      if (script.readyState == "loaded" || script.readyState == "complete") {
207
        script.onreadystatechange = null;
208
        if (typeof callback == "function") {
209
          callback();
210
        }
211
      }
212
    };
213
  } else {
214
    //Others
215
    script.onload = function () {
216
      if (typeof callback == "function") {
217
        callback();
218
      }
219
    };
220
  }
221
222
  script.src = url;
223
  document.getElementsByTagName("head")[0].appendChild(script);