PricingBlog

Script only executes when API is auto fetched

  • .kittiphum-1278130469052878848

    Kittiphum

    1 year ago

    Hi there,

    I am building a LMS App and i want to integrate DearFlip (3D Flipbook). I have already set it up successfully in Wized and thought it would be just copy and paste but i am now struggling with one perticular part where DearFlip only works when the API is auto fetched. As soon as i set it up to get PDFs on change of an input it doens't work no more. This is crucial for the LMS to complete.
    1
  • max.kayr-1278186290692624459

    Max

    1 year ago

    Hi! Please share a few screenshots or a screen recording of your setup, the expected behavior and the behavior you get instead. The link to the project would be nice as well. Then someone can help 😊
  • .kittiphum-1278270622979588147

    Kittiphum

    1 year ago

    https://update-heilkunde_informativ.toddle.site/DearFlip-copy the first link is where i get the user on load and then on success it should get the PDF sources

    https://update-heilkunde_informativ.toddle.site/DearFlip
    the second link is where i auto fetch the scripts and the userId is already put into the parameters
  • max.kayr-1278278640550940765

    Max

    1 year ago

    It appears that the script from DearFlip only executes on DOM ready, that means that only elements that are on the page when it is loaded will have the FlipBook functionality. This works when auto-fetch is enabled. Auto-fetch gets the elements server-side. The DearFlip code is executed client-side. That means the elements are already there. Now if you fetch data On Load (=client-side), DearFlip has already been initialized and won't recognize the changes.
  • .kittiphum-1278307892302188621

    Kittiphum

    1 year ago

    so i have to reinitialized right
  • max.kayr-1278310235840450620

    Max

    1 year ago

    You need to check with their documentation on how to handle this scenario
  • .kittiphum-1278311791658795059

    Kittiphum

    1 year ago

    got it to work
  • Tod-1278311793156165642

    Tod

    1 year ago

    Great energy @Kittiphum! Your continuous contribution to the toddle Community just made you advance to Community Level 1!
  • .kittiphum-1278311835061325956

    Kittiphum

    1 year ago

    thanks for your help!
  • max.kayr-1278313630118707271

    Max

    1 year ago

    Sure 🙂