[Violation] Avoid using document.write()

Hello all,

In chrome i get the next violation with all libarys in moodle.

[Violation] Avoid using document.write()

It concern the next function:

// Insert H5Ps that should be in iframes.
  H5P.jQuery('iframe.h5p-iframe:not(.h5p-initialized)', target).each(function () {
     var contentId = H5P.jQuery(this).addClass('h5p-initialized').data('content-id');
     this.contentDocument.open();
     this.contentDocument.write('<!doctype html><html class="h5p-iframe"><head>' + H5P.getHeadTags(contentId) + '</head><body><div class="h5p-content" data-content-id="' + contentId + '"/></body></html>');
    this.contentDocument.close();
});

Is this going to be a problem?

Kind regards,
Koen

 

BV52's picture

Hi Koen,

Afaik as I know this will only be problematic if the user that is visiting the page has a very slow connection. But in terms of creating and viewing contents as long as they have decent connection it shouldn't be a problem.

-BV52