WeBWorK Main Forum

Embed WW problem in HTML

Re: Embed WW problem in HTML

by Glenn Rice -
Number of replies: 0

This may be a cross origin issue.  Is the html file that includes this iframe being served from the same server, or is it located on another server?  If it is on another server, then you will need to set the "Access-Control-Allow-Origin" header to "*".  This can be done in the /opt/webwork/webwork2/conf/webwork.apache2-config.dist file.  Add

<IfModule mod_headers.c>
    <Location /webwork2/html2xml>
        Header set Access-Control-Allow-Origin "*"
    </Location>
    <Location /webwork2_files>
        Header set Access-Control-Allow-Origin "*"
    </Location>
</IfModule>

to the end of that file.

You will also need to make sure that the apache2 headers module is enabled.  This can be accomplished with "sudo a2enmod headers".