Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I just installed Mathematica 8.0.4.0, which has a CDF Deployment Wizard. This is supposed to make it easy to post a CDF file on a WordPress blog. I tried it, and it indeed was easy; the problem is that when I Previewed the post, the CDF logo showed up and created a rectangle that quickly turned solid gray.

This is the entire code I used in my blog:

<p>&nbsp;</p> <p><strong>The example</strong></p> <div> <script
type="text/javascript"
src="http://www.wolfram.com/cdf-player/plugin/v2.1/cdfplugin.js"></script>
<script type="text/javascript"> var cdf = new cdfplugin();
cdf.embed('http://www.abstractmath.org/Mathematica/Elaborate Riemann
Example.cdf', 427, 536); </script>     </div>

The two scripts were created by the Wizard and pasted into the post. You can download the file Elaborate Riemann Example.cdf yourself from the URL above, and, if you have CDF Player on your computer, you can run it. It works fine on my computer. But it won't appear within the post.

Any ideas why?

share|improve this question
    
Could you please give URL to the page which does not work? –  Vitaliy Kaurov May 5 '12 at 23:57
    
Just a guess: what if you change 'http://www.abstractmath.org/Mathematica/Elaborate Riemann Example.cdf' to 'http://www.abstractmath.org/Mathematica/Elaborate%20Riemann%20Example.cdf'? –  Szabolcs May 6 '12 at 12:21
    
The web page is at abstractmath.org/Word%20Press/?p=4362 –  SixWingedSeraph May 6 '12 at 14:06
    
Putting %20 in for space doesn't work. –  SixWingedSeraph May 7 '12 at 1:04

2 Answers 2

Whatever the problem might be, using this official Wordpress plugin from Wolfram Research should resolve it: http://wordpress.org/extend/plugins/wolfram-cdf-plugin/

share|improve this answer
    
I tried that and it made no difference. –  SixWingedSeraph May 6 '12 at 14:05
1  
not if it contains content that is insecure. –  Mike Honeychurch May 7 '12 at 22:04

I downloaded your notebook to my Download directory and opened it. The Download directory is unsafe. This is what it looked like:

enter image description here

So the reason why you get a grey box in your embedded CDF is that it is perceived as being unsafe.

Modify your code to this:

cdf.embed('http://www.abstractmath.org/Mathematica/Elaborate Riemann 
Example.cdf', 427, 536,{fullscreen:'true'});

and it will allow the enable dynamics button to appear. You can then switch on the dynamic content and the CDF will be treated as safe. This will get you to the next stage. Whether or not it will work after that will depend on what other things you have in your CDF -- i.e. as long as you have content that is allowed (no import/export etc.) it should work.

share|improve this answer
    
What I now know is that the trouble is in the cdf file, not with the code that loads it into the blog. If you look at the blog now -- abstractmath.org/Word%20Press/?p=4362 -- you will see that I added another cdf file from a previous post that worked in that post and works in the current one as well. –  SixWingedSeraph May 7 '12 at 1:06
    
Did you try fullscreen:true? cut and pasted your link but it does not exist. –  Mike Honeychurch May 7 '12 at 1:24
    
The Notebook Security tutorial in Mathematica Help says that a notebook will produce the Unsafe Dynamics message if (among other things) it uses conversion between expressions and strings or options control (among others). My notebook uses both of these, so it appears that my only recourse is to do what Mike Honeychurch suggested and add "{fullscreen:'true'}" to the embedding code, and then say in my post that the reader may click on the Enably Dynamics button to manipulate the diagram. –  SixWingedSeraph May 7 '12 at 1:50
    
Mike: "abstractmath.org/Word%20Press/?p=4362"; works on my browser (Chrome). I tried it just now. –  SixWingedSeraph May 7 '12 at 1:53
    
All I get is page not found. Sorry but until you can provide a link that loads there is nothing further I can add. –  Mike Honeychurch May 7 '12 at 3:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.