Javascript troubles | XM Community
Solved

Javascript troubles

  • 1 November 2018
  • 1 reply
  • 10 views

Hi all - I've searched high and low on the internet, and can't find much. What I have found hasn't worked. Hoping that someone here can guide me!

We're using an online video platform/LMS to host a Qualtrics survey in a module. That survey is referenced in a 'course' on the LMS through a link. The LMS company is telling us that we need to add some lines of JS to the 'form'/survey to get it to size properly and mark the course complete (so that it is a seamless experience). Basically, the survey will appear in an iFrame on the video platform.

The three lines of code that we need to add are...
Load the JS library: <script type="text/javascript" src="http://companyname.com/tc/api/coname-custom-api.js"></script>
Set the iFrame size: coname.setSize(980,523);
Mark the course complete: coname.setComplete();

From what I've read, loading should occur in the header (i.e., Look and Feel > Advanced > etc.). We plugged the line exactly as it is above into the header. Then the iFrame size and setting the course complete should occur in the appropriate places of the JS editor for the question(s). We've done this as well.

Unfortunately, the result is that the survey doesn't seem to load at all in the iFrame. Looking at the source of the Qualtrics survey page, our assumption is that the library isn't loading properly. I don't see any errors on the console that would impact it loading.

Am I putting code in the right spot? Missing a step (or two)?

Any help would be appreciated! Thanks!
icon

Best answer by LaurenK 4 December 2018, 00:06

View original

1 reply

Userlevel 7
Badge +13
Hey @ascheurer! We would recommend first checking to ensure you have the require iFrame permission enabled for your account! If you are unsure if you have this permission enabled, you can reach out to your Brand Administrator! If you do have this permission enabled, try to add something simple as an iFrame. If that works, perhaps reaching out to LMS asking for documentation on their suggested setup will be a good next step!

Leave a Reply