I want to have students submit articles that include Mathematica demonstration projects in a document that is on Google sites. I am having problems with embedding the JS code. Could you provide step-by-step instructions.
Upload the CDF file (source.cdf) and the HTML page (index.htm) into a folder on the server. Keep both files in same folder for simplicity.
Edit the index.htm file using a text editor and type this line in the HTML anywhere you want the CDF to show up and play in the web page:
<embed src="source.cdf" width="800" height="700">
Change the width and height to the correct values as needed so the the content area reserved on the web page matches well with the size of the display you want.
If this still does not work for you, please follow up with error messages. Make sure to use CDF export from Mathematica, using
From comment below, may be there is some confusion, so I thought I make the steps more clear.
Here are the steps:
1 Student needs Mathematica to make CDF
2 Student starts Mathematica, opens new notebook, makes HW assignment and Manipulate in the notebook.
3 Student exports the notebook to CDF file as standalone. Now there are 2 files in student folder on their PC (university computer or student own computer). one file is called hw.nb and one called hw.cdf
4 Student makes an index.htm file using a text editor, here is a template for one to use:
<!DOCTYPE html> <html> <head> <title>my HW</title> </head><body> <div> <embed src="hw.cdf" width="800" height="700"> </div> </body> </html>
5 Now there are 3 files in student folder hw.nb, hw.cdf and index.htm
6 Student uploads the files hw.cdf and index.htm to server, on a folder there. Keeping both files in same folder on server.
From comment below: