Message Boards Message Boards

CDF fails to load in a web page

Posted 11 years ago
I tried to upload a cdf file to my web page. However the generated HTML code to embed solution did not work and only appears the symbol of Mathematica spinning. Could you help me? Here is the URL of my web page 
POSTED BY: Ana Squadri
5 Replies
I see that you CDF works fine now when I go to your page. 

POSTED BY: Vitaliy Kaurov
Nasser - page loaded for me fine with that URL. But indeed the CDF does not load.

Ana Squadri - please do not make multiple posts with identical content. If you'd like to edit or add more information to your original post - you can always edit it by clicking "Edit" link in the bottom right corner of the post.

Do not forget to include SaveDefinitions -> True option if you ose Initialization - like tihs:
Manipulate[g[x], {x, 0, 1}, Initialization :> (f[x_] := x), SaveDefinitions -> True]
Also please first consult our tutorials and make sure you do everything by the book:
POSTED BY: Vitaliy Kaurov
the page you linked to does not exist. I get this error:

    "The page you tried to access does not exist on our server."
POSTED BY: Nasser M. Abbasi
Posted 11 years ago
The page changed because I am trying to solve my problem. You can help me, but I can not stop and wait. My example was copied from Mathematica. My web page WIG does not accept JavaScript. This is the problem!
POSTED BY: Ana Squadri
The code to embed your cdf should look something like this:
var cdf = new cdfplugin();
cdf.setDefaultContent('<a href=""><img src="Untitled.png"></a>');
cdf.embed('Untitled.cdf', 267, 121);
To get this code, for your CDF, open the notebook you are using to make the CDF and go to File > CDF export > Web Embeddable.
It is important to make sure that the CDF and the image are located in the same directory as the html file. If not, you will need to give the directory to the png file and the cdf file.
Put an image in the same directory as the CDF and see if you can include it in your webpage using an IMG tag. Can you? If not, then this must be resolved first. Give the Img tag the file path to the image. You will need to do the same with the CDF.

When you say you see the mathematica spinning loop, what do you mean. Can you provide a screenshot of what you see?
POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract