• Hello kudos ,

    h5p plugin is best plugin ever but i have some issue with that can you please tell me what should i do for my issue. the issue is i have added h5p shortcode in wp-admin side in one of the page editor but when i am doing ajax call the content all loading but h5p content not laoding just showing iframe but innder <html></html> not appending do i need to refresh the h5p code in my ajax call function ot anything please save me from this issue..i did add in h5p.init() method in jquery also but did not work all the h5p js there in site but when i am doing ajax call the in iframe content not adding so that’s why have issue in js file h5p.js file..

    Thanks in advance..much needed your help!!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author icc0rz

    (@icc0rz)

    Hi,

    In case H5Ps are loaded via AJAX, or displayed via other JavaScript they will not start automatically. The custom code or script will have to “start” the H5P content once it’s visible. This is typically done with H5P.init(container); where container is the element that the loaded HTML was put into.
    In addition, with AJAX, you have to make sure all required assets are loaded and added to the page, which means JS files, CSS files, and the H5PIntegration object.

    Thread Starter savanitina

    (@savanitina)

    Thank you for get back to me..

    i did attached all js and css files but seems like html content not loading i did initialize also H5P.init() but its not working..

    the error i am getting is :

    VM157 h5p.js:425 Uncaught TypeError: Cannot read property 'styles' of undefined
        at Object.H5P.getHeadTags (VM157 h5p.js:425)
        at HTMLIFrameElement.<anonymous> (VM157 h5p.js:391)

    when you say container what it would be ? can you check with my site ?

    • This reply was modified 4 years, 5 months ago by savanitina.

    Hi,

    As I understand it, H5P does not automatically load in ajax calls and it needs to be done manually. I reviewed the issue on Github but could not find a solution

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘H5P is not working with ajax call’ is closed to new replies.