Viewing 10 replies - 1 through 10 (of 10 total)
  • In your AJAX calls, call the janrain.engage.signin.widget.init() function. It should load the widget.

    Thread Starter disagree

    (@disagree)

    thanks!

    Thread Starter disagree

    (@disagree)

    which results in ‘TypeError: Cannot read property ‘POWERED_BY_PREFIX’ of undefined’

    i have in the ajax loaded content a “<div id=”janrainEngageEmbed”></div>” but it seems it creates its own ‘<div id=”janrainEngageEmbed” style=”display: none;”>…’ which it then cannot access as it gets the first #janrainEngageEmbed instead

    i could maybe rename the janrainEngangeEmbed to janrainContainer, run the janrain.engage.signin.widget.init(), and then move #janrainEngageEmbed into the container

    but is there a better solution?

    Hey, disagree —

    It looks like the issue could be that you have two <div id=”janrainEngageEmbed”></div>s on the same page, probably one in the AJAX code and another sitting at the top of the page… is that correct? Like the mighty Highlander, there can be only one, mainly for the obvious reason that id elements are supposed to be unique on a page. Our JavaScript automatically appends the display: none; css attribute to second, third, fourth instances of the <div id=”janrainEngageEmbed”></div>, partly to avoid that conflict.

    If you must have the widget multiple times in the page, one work around is to do exactly what you described which is to move the #janrainEngageEmbed element around into different containers so it loads where it’s needed. There’s an example of that up in our Community forums here: https://community.janrain.com/entries/23240063-Put-the-sign-in-widget-on-two-spots-in-the-same-page

    Hope this helps.

    Thread Starter disagree

    (@disagree)

    It seems that the janrain .js is .append()’ing this hidden janrainEngageEmbed to the end of the <body> on every page

    I only specified one <div> in the code though; but when I check with chrome inspector it seems right before the </body> tag there’s a hidden janrain div sitting.

    Thread Starter disagree

    (@disagree)

    Anyway, when I do a hard-refresh of the page I have my <div> on, I’m getting an error thrown :

    Uncaught TypeError: Cannot read property 'POWERED_BY_PREFIX' of undefined login:111
    z login:111
    b login:97
    g

    On this page is only 1 ‘<div id=”janrainEngageEmbed”></div>’ ( the other div hasn’t been added, maybe due to this error )

    Thread Starter disagree

    (@disagree)

    I’m working with the MINIMUM theme on this btw

    It works when the page is static e.g. /page/, but #/page/ is throwing the errors. It seems the javascript from login is running before the janrain settings are initialized..

    disagree, do you have a URL I can look at?

    Thread Starter disagree

    (@disagree)

    yes but it’s a client’s WP, we would need to coordinate this privately

    This was resolved privately; there was an AJAX script associated with the theme which kept re-instantiating the Engage JavaScript every time a new tab was loaded. A quick change to the theme fixed this.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Janrain, RPX and AJAX’ is closed to new replies.