# Can CDF file embedded in a web page receive external parameters?

I know that I can embed a CDF file inside a web page by using:

1. The embed tag.
2. An object tag with an embed tag inside (better than 1).
3. Using the JavaScript provided by Wolfram (better than 2).

My question is how can I pass some data to the CDF file. In the case of Flash, there is a flashvars attribute precisely for this, but I can't find the equivalent for this in Wolfram's CDF deployment documentation.

I need this because I plan to embed a CDF in a set of pages that are similar but each for a different set of data. And I want to generate a single CDF for all of them.

If this is not possible in this direction, I would be interested in knowing about solutions in the opposite direction: reading the DOM from the CDF file as this would solve my problem too.

UPDATE (June 16, 2015): This is now possible in CDF Player 10 with CurrentValue["PluginParameters"]. For more information, please see this community thread: http://community.wolfram.com/groups/-/m/t/309578

-

You cannot import data to a web embedded CDF:

http://www.wolfram.com/player-pro/how-player-pro-compares.html

...that is to say in principle you can't. However if you read this thread:

Deploying Mathematica Content Online

you will note that @Jens demonstrated that it was possible to import data from a URL. However after investigating this I was told by Wolfram that this was a bug that will be closed in future builds so you cannot rely on this.

-
Thank you. I guess I will need to use webMathematica, but this will put more workload on the server to generate over and over almost the same CDF file. In this particular area Flash has an advantage. – Gustavo Delfino Mar 19 '12 at 2:20
With the release of Mathematica 9 URL importing is a free CDF feature. Please see @AndreKuzniarek answer for details. – Vitaliy Kaurov Dec 6 '12 at 18:50

Apparently, one of the enhanced capabilities available in an enterprise license of Mathematica is the capability to send data to your CDF file just like when using Flash.

I have not been able to find the documentation for this in Wolfram's site, but I'll update my answer when I do.

UPDATE: As confirmed by Andre Kuzniarek, it is still not possible to send data to the CDF via HTML or Javascript.

-
The enterprise version provides a different signature to the CDF which enables the same features you would get in Player Pro. – David Creech Nov 5 '12 at 22:00
@david what is not clear to me is that in Player Pro documentation at wolfram.com/player-pro there is nothing that specifically says that you can send data from the HTML to the CDF file. Also, in wolfram.com/cdf/adopting-cdf/deploying-cdf/web-delivery.html there is no mention to special Player Pro parameters. If this parameter exits, what is its name? Not advertising this can slow down CDF adoption. – Gustavo Delfino Nov 6 '12 at 15:43
Please see @AndreKuzniarek clarification of Enterprise option and related information. – Vitaliy Kaurov Dec 6 '12 at 18:48
re: your Update. Andre's answer refers to web embedded CDFs. Stand alone CDFs that have been pro signed can import/export etc. – Mike Honeychurch Dec 6 '12 at 21:48
Yes I was referring to the web embedded CDF. I made a small edit to make it clear. – Gustavo Delfino Dec 6 '12 at 23:04

With Version 9, CDF Player is officially supporting import via URL. This is currently the only way to bring any data into a web embedded CDF or notebook, regardless of license level. Other methods are being explored, particular for exchanging data with the surrounding DOM. Stay tuned for more information on this to come.

Please consult the following table for an updated comparison of FreeCDF vs. Enterprise/Player Pro vs. Mathematica functionality:

http://www.wolfram.com/player-pro/how-player-pro-compares.html

and here for more details about FreeCDF vs. Enterprise licensing: