Wolfram Blog
Vitaliy Kaurov

Mathematica Q&A Series: CDF Embedding in a Nutshell

February 22, 2012 — Vitaliy Kaurov, Technical Communication & Strategy

Got questions about Mathematica? The Wolfram Blog has answers! We’ll regularly answer selected questions from users around the web. You can submit your question directly to the Q&A Team.

This week’s question comes from Tom, a teacher who wants to post his lessons online:

How can I use CDF to include Mathematica content on web pages?

Read below or watch this screencast for the answer (we recommend viewing it in full-screen mode):

We’re being asked this question more and more, and I am really glad to see how quickly the Computable Document Format (CDF) is being adopted. Whether you want to deliver your CDF content on your website or blog or as a desktop application, Mathematica 8.0.4 makes it quick and easy with a new CDF Web Deployment Wizard.

Once you’ve created your interactive content, select the cell you want to embed in your website. Choose File » Deploy » Embed in HTML… to begin processing your selection:

CDF Web Deployment Wizard

Just follow the steps in the wizard; the last step will provide a few lines of JavaScript code. Paste that code into the HTML of your web page where you want your CDF to appear.

The CDF Standalone Deployment Wizard (File » Deploy » Standalone…) provides the same simple process for saving desktop apps.

If you host your own WordPress site, you can easily add CDF content to your posts or pages with the Wolfram CDF Plugin for WordPress. You will need to host the blog yourself or have permissions to upload supplemental files that the blog can access.

Mathematica 8.0.4 also includes new functions for deploying CDFs programmatically. Use CDFDeploy and CDFInformation to create your CDF file and get the code fragment for embedding.

For further details on CDF deployment, see the Deploying CDF web page.

Download this post as a CDF file.

If you have a question you’d like answered in this blog, you can submit it to the Q&A Team. For daily bite-sized Mathematica tips, follow our @MathematicaTip Twitter feed.

Posted in: Mathematica Q&A
Leave a Comment

6 Comments


D

Thanks for the useful webcast. I’d love to use CDF embedded in my webpages, but since I only have linux computers, it is somewhat frustrating. Is there any update on when the linux browser CDF plugin will become available, and what is the hurdle in providing such a plugin?

Posted by D    February 22, 2012 at 11:07 pm
Alex Isakov

Hi, Vitaliy! Could you, please, provide some tips on deploying files to mediawiki sites?

Posted by Alex Isakov    February 23, 2012 at 4:46 am
Michael Stern

Will CDF files ever work within iOS browsers?

Posted by Michael Stern    February 23, 2012 at 7:09 pm
Vitaliy Kaurov

Michael, we are currently working on this functionality and recently released the preview blog post. Please have a look here: http://blog.wolfram.com/2012/02/17/a-preview-of-cdf-on-ipad/

Alex and D, thank you for the feedback, we will pass along your requests to the development teams.

Posted by Vitaliy Kaurov    February 24, 2012 at 5:29 pm
Ingvar

This is very exciting. I wonder how simple it would be for a teacher in physics to make small interactive presentation for different topics for the students. I see a lot of potential in this form of presentation.

Posted by Ingvar    March 29, 2012 at 10:59 am
Tom De Vries

Hi! I am posting CDF content at a wikispaces site, and so far, it’s great. I am wondering though… when I reveal the animation controls and type a number in the input area… nothing happens or sometimes is displays a partial error message that I can’t quite see. What do I need to do to insure users can use the slider as well as entering values in the input area?

Tom

Posted by Tom De Vries    March 29, 2012 at 10:36 pm


Leave a comment

Loading...

Or continue as a guest (your comment will be held for moderation):