This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a perl script that parses a html file (replacing sections of html with content from files or such).
If I put in :
If I create a simple html file with at the top everything works fine, even the canvas.
What should I be printing out for the headers to get the page to display AND the canvas to be recognized? Thanks in advance.
If I have a plain .html page with a canvas tag in it and <!DOCTYPE html> at the top the canvas displays fine (just an empty canvas with border set).
If I have a html page (even the same html as above) that gets read in by a perl script on the server and all the perl script does is spit out the content of the html page via prints (canvas tag and all) I get a 502 error. So the URL instead of being something.html it's some_perl_script.pl (which reads the html page and spits it back as a response). If I insert a print of "Content-type: text/html\n\n" in the perl script the page comes up in the browser but the canvas tag isn't recognized because there is no <!DOCTYPE html> now just the Content-type header. If I try to mix and match the Content-type and DOCTYPE lines to be sent back to the browser (in the perl script) I'm still unsuccessful.
The difference between the cases is one way it's embedded in a html page that is getting called directly (i.e. the URL points to the html page) and the other way is a perl script is being called in the browser (i.e. URL points to the .pl) - the script reads the html and prints content to output.