470,604 Members | 2,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,604 developers. It's quick & easy.

Javascript generating SMIL document

Hi all,

I am trying to use javascript to generate a SMIL document to give as
input to the browser (in another window or in the same). I tried this:

<HTML>
<HEAD>
<TITLE>My First JavaScript</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
myWindow = window.open("", "tinyWindow", 'toolbar,width=150,height=100')
myWindow.document.write("<smil><head><layout><root-layout width="678"
height="624" background-color="#fcf4e5"/><region id="title-region"
left="0" top="0" width="678" height="60"
fit="meet"/></layout></head><body><par><text id="title"
region="title-region" begin="0"
src="http://media.cwi.nl:8080/cocoon/cuypers/oai/text?Content=Biography&width=678&height=60&duratio n=84&fontsize=6&fgcolor=%23600000&bgcolor=%23f6d42 a&ext=.rt"
dur="84"/></par></body></smil>")
myWindow.document.close()
//-->
</SCRIPT>
</BODY>
</HTML>

but it does not work. I had a look at some FAQ but I could not find
anything. Now I am doubting that Javascript can only generate HTML
documents. Any clue?

Thanks,

Stefano

--
Stefano Bocconi (St*************@cwi.nl) http://www.cwi.nl/~sbocconi
Multimedia and Human-Computer Interaction
CWI (www.cwi.nl), Kruislaan 413, 1098 SJ Amsterdam, The Netherlands Tel: +31 20 592 4202 Fax: +31 20 592 4312

Jul 20 '05 #1
1 1686


Stefano Bocconi wrote:
I am trying to use javascript to generate a SMIL document to give as
input to the browser (in another window or in the same). I tried this:

<HTML>
<HEAD>
<TITLE>My First JavaScript</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
<!--
myWindow = window.open("", "tinyWindow", 'toolbar,width=150,height=100')
myWindow.document.write("<smil><head><layout><root-layout width="678"
height="624" background-color="#fcf4e5"/><region id="title-region"
left="0" top="0" width="678" height="60"
fit="meet"/></layout></head><body><par><text id="title"
region="title-region" begin="0"
src="http://media.cwi.nl:8080/cocoon/cuypers/oai/text?Content=Biography&width=678&height=60&duratio n=84&fontsize=6&fgcolor=%23600000&bgcolor=%23f6d42 a&ext=.rt"
dur="84"/></par></body></smil>")
myWindow.document.close()
//-->
</SCRIPT>
</BODY>
</HTML>

but it does not work. I had a look at some FAQ but I could not find
anything. Now I am doubting that Javascript can only generate HTML
documents. Any clue?


Yes, current browser pretty much only allow to document.write text/html
content.
If it is NN4 and you have a plugin set up for smil content then
myWin.document.open('put smil content type here');
myWin.document.write('<smil>...</smil>');
myWin.document.close()
should do.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by sb1 | last post: by
1 post views Thread by Jarrod Hyder | last post: by
136 posts views Thread by Matt Kruse | last post: by
2 posts views Thread by sorobor | last post: by
reply views Thread by =?Utf-8?B?YmVydHB1?= | last post: by
reply views Thread by Fred Ho | last post: by
4 posts views Thread by =?Utf-8?B?R1ROMTcwNzc3?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.