Skip to content
This repository
Browse code

fixed recaptcha init

  • Loading branch information...
commit b03eb10f48c58e28b5ecd38d2b045f0cc1c48f4c 1 parent 0a878fc
Bilal Amarni authored February 05, 2013
17  Resources/views/Form/jquery_layout.html.twig
@@ -32,11 +32,18 @@
32 32
 {% spaceless %}
33 33
     <script type="text/javascript" src="{{ asset("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js") }}"></script>
34 34
     <script type="text/javascript">
35  
-        window.addEventListener(
36  
-            'load',
37  
-            Recaptcha.create('{{ public_key }}', '{{ id }}_div', {{ configs|json_encode|raw }}),
38  
-            false
39  
-        );
  35
+        function genemu_recaptcha_load()
  36
+        {
  37
+            Recaptcha.create('{{ public_key }}', '{{ id }}_div', {{ configs|json_encode|raw }});
  38
+        }
  39
+
  40
+        if (window.addEventListener) {
  41
+            window.addEventListener('load', genemu_recaptcha_load, false);
  42
+        } else if (window.attachEvent) {
  43
+            window.attachEvent('onload', genemu_recaptcha_load);
  44
+        } else {
  45
+            window.onload = genemu_recaptcha_load;
  46
+        }
40 47
     </script>
41 48
 {% endspaceless %}
42 49
 {% endblock genemu_recaptcha_javascript %}

0 notes on commit b03eb10

Please sign in to comment.
Something went wrong with that request. Please try again.