jeudi 22 janvier 2015

ReCaptcha difficulties in Ember.js component

The widget works on its own if I use $.getScript('//www.google.com/recaptcha/api.js') after inserting <div class='g-recaptcha' data-sitekey='mykeyhere'></div>


I cannot get the callback to fire for success:



<div class='g-recaptcha' data-callback=myNameSpace.callback data-sitekey='mykeyhere'></div>


and when I go the explicit rendering route I can't get the onload callback to fire:



$.getScript('//www.google.com/recaptcha/api.js?render=explicit&onload=myNameSpace.onloadCallback')


There are no console errors, and the callbacks don't fire at all. The callbacks are on the global namespace. The <div class='g-recaptcha' data-sitekey='mykeyhere'></div> is in the component's template, the $.getScript is fired in them component's didInsertElement hook (after div is inserted), and the callback is access from the global namespace.


I don't understand why this isn't working and I'm running out of debug paths to travel down. Any insights would be greatly appreciated!





Aucun commentaire:

Enregistrer un commentaire