javascript - Reloading janrain widget -


i have janrain social login widget in place on site , processing authentication requests ajax.

in situations, though there successful login social site (say, twitter), want prevent login on website.

when happens, janrain widget stuck saying "loading...", though there's nothing more do. however, user able try logging in again through site (say, facebook).

currently, way make happen refresh entire page. not convenient, not large burden either. still, avoid requiring this.

here code - exact copy/paste of janrain provides:

//initialization of widget on page load (function() {     if (typeof window.janrain !== 'object') window.janrain = {};     window.janrain.settings = {};      janrain.settings.tokenurl = the_url     janrain.settings.tokenaction='event';      function isready() { janrain.ready = true; };     if (document.addeventlistener) {      document.addeventlistener("domcontentloaded", isready, false);     } else {       window.attachevent('onload', isready);     }      var e = document.createelement('script');     e.type = 'text/javascript';     e.id = 'janrainauthwidget';      if (document.location.protocol === 'https:') {       e.src = 'https://rpxnow.com/js/lib/(domain)/engage.js';     } else {       e.src = 'http://widget-cdn.rpxnow.com/js/lib/(domain)/engage.js';     }      var s = document.getelementsbytagname('script')[0];     s.parentnode.insertbefore(e, s); })();  //handler ajax authentication function janrainwidgetonload(){     janrain.events.onproviderlogintoken.addhandler(function(tokenresponse) {         $.ajax({             //(blah blah blah)         });     }); }  <!-- widget inserted named div --> <div id="janrainengageembed"></div> 

i've tried making initialization function named function called explicitly when page loads. though works initialization of widget, calling again fails - after making jquery call kill html inside target div widget inserted.

ideas? thanks!

i believe problem yet register localhost url janrain. try going application settings under deployment tab , adding local url it. localhost.

then change token url landing page. ...

janrain.settings.tokenurl = 'https://localhost:8000/home' 

good luck!


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -