473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to dynamically set content of iframe?

Hello,
In line 8 below, I am trying to set the content of the iframe, but
receive an error.
Movie 2 plays normally.
Movie 1 fails.
This example is from the QuickTime docs. (example
1-4)http://developer.apple.com/documenta...ipt/index.html
Does anyone know what might be the problem?
thanks,
Anil
---------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Simple QuickTime Movie Controls</title>
<script language="JavaScript"/* define function that calls
QuickTime's "Play" method */ function PlayIt(anObj) { anObj.Play(); }
/* define function that calls QuickTime's "Stop" method */ function
StopIt(anObj) { anObj.Stop(); } function GeneratePlayer() {
alert("in \"GeneratePlayer()\"");
window.frames['testIframe'].innerHTML = "<object
classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"
codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" id=\"movie1\"
height=\"160\" width=\"180\"<param name=\"src\" value=\"C:\Program
Files\QuickTime\Sample.mov\"<embed src=\"C:\Program
Files\QuickTime\Sample.mov\" type=\"video/quicktime\"
pluginspage=\"www.apple.com/quicktime/download\" name=\"movie1\"
enablejavascript=\"true\" height=\"160\" width=\"180\"></object>";
}
</script>
</head>
<body>
<pThis page uses JavaScript to control a QuickTime movie... </p>
<div align="center">
<table>
<tbody>
<tr>
<td width="200"<iframe id="testIframe"
name="testIframe"></iframe<a
href="javascript:GeneratePlayer();">GeneratePlayer ()</a><br>
<pMovie1 </p>
</td>
<td width="200"<object
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
id="movie2" height="160" width="180"<param
name="src" value="C:\Program Files\QuickTime\Sample.mov">
<embed src="C:%5CProgram%20Files%5CQuickTime%5CSample.mov "
type="video/quicktime"
pluginspage="www.apple.com/quicktime/download" name="movie2"
enablejavascript="true" height="160" width="180"></object>
<pMovie2 </p>
</td>
</tr>
</tbody>
</table>
</div>
<p>Pass movie name as a parameter to JavaScript functions defined
locally: <br>
<a href="javascript:PlayIt(document.movie1);">PlayIt( movie1)</a><br>
<a href="javascript:StopIt(document.movie1);">StopIt( movie1)</a><br>
<a href="javascript:PlayIt(document.movie2);">PlayIt( movie2)</a><br>
<a href="javascript:StopIt(document.movie2);">StopIt( movie2)</a><br>
</p>
<p>Control movie by name directly: <br>
<a href="javascript:document.movie1.Play();">movie1.P lay()</a><br>
<a href="javascript:document.movie1.Stop();">movie1.S top()</a><br>
<a href="javascript:document.movie2.Play();">movie2.P lay()</a><br>
<a href="javascript:document.movie2.Stop();">movie2.S top()</a><br>
</p>
<p>Replace a movie by name directly: <br>
<a
href="javascript:document.movie1.SetURL('MyOther.m ov');">movie1.SetURL(MyOther.mov)</a><br>
<a
href="javascript:document.movie1.SetURL('My.mov'); ">movie1.SetURL(My.mov)</a><br>
<a
href="javascript:document.movie2.SetURL('MyOther.m ov');">movie2.SetURL(MyOther.mov)</a><br>
<a
href="javascript:document.movie2.SetURL('My.mov'); ">movie2.SetURL(My.mov)</a><br>
</p>
</body>
</html>

Jan 2 '07 #1
1 14049
no replies?

Anil wrote:
Hello,
In line 8 below, I am trying to set the content of the iframe, but
receive an error.
Movie 2 plays normally.
Movie 1 fails.
This example is from the QuickTime docs. (example
1-4)http://developer.apple.com/documenta...ipt/index.html
Does anyone know what might be the problem?
thanks,
Anil
---------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Simple QuickTime Movie Controls</title>
<script language="JavaScript"/* define function that calls
QuickTime's "Play" method */ function PlayIt(anObj) { anObj.Play(); }
/* define function that calls QuickTime's "Stop" method */ function
StopIt(anObj) { anObj.Stop(); } function GeneratePlayer() {
alert("in \"GeneratePlayer()\"");
window.frames['testIframe'].innerHTML = "<object
classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\"
codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" id=\"movie1\"
height=\"160\" width=\"180\"<param name=\"src\" value=\"C:\Program
Files\QuickTime\Sample.mov\"<embed src=\"C:\Program
Files\QuickTime\Sample.mov\" type=\"video/quicktime\"
pluginspage=\"www.apple.com/quicktime/download\" name=\"movie1\"
enablejavascript=\"true\" height=\"160\" width=\"180\"></object>";
}
</script>
</head>
<body>
<pThis page uses JavaScript to control a QuickTime movie... </p>
<div align="center">
<table>
<tbody>
<tr>
<td width="200"<iframe id="testIframe"
name="testIframe"></iframe<a
href="javascript:GeneratePlayer();">GeneratePlayer ()</a><br>
<pMovie1 </p>
</td>
<td width="200"<object
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
id="movie2" height="160" width="180"<param
name="src" value="C:\Program Files\QuickTime\Sample.mov">
<embed src="C:%5CProgram%20Files%5CQuickTime%5CSample.mov "
type="video/quicktime"
pluginspage="www.apple.com/quicktime/download" name="movie2"
enablejavascript="true" height="160" width="180"></object>
<pMovie2 </p>
</td>
</tr>
</tbody>
</table>
</div>
<p>Pass movie name as a parameter to JavaScript functions defined
locally: <br>
<a href="javascript:PlayIt(document.movie1);">PlayIt( movie1)</a><br>
<a href="javascript:StopIt(document.movie1);">StopIt( movie1)</a><br>
<a href="javascript:PlayIt(document.movie2);">PlayIt( movie2)</a><br>
<a href="javascript:StopIt(document.movie2);">StopIt( movie2)</a><br>
</p>
<p>Control movie by name directly: <br>
<a href="javascript:document.movie1.Play();">movie1.P lay()</a><br>
<a href="javascript:document.movie1.Stop();">movie1.S top()</a><br>
<a href="javascript:document.movie2.Play();">movie2.P lay()</a><br>
<a href="javascript:document.movie2.Stop();">movie2.S top()</a><br>
</p>
<p>Replace a movie by name directly: <br>
<a
href="javascript:document.movie1.SetURL('MyOther.m ov');">movie1.SetURL(MyOther.mov)</a><br>
<a
href="javascript:document.movie1.SetURL('My.mov'); ">movie1.SetURL(My.mov)</a><br>
<a
href="javascript:document.movie2.SetURL('MyOther.m ov');">movie2.SetURL(MyOther.mov)</a><br>
<a
href="javascript:document.movie2.SetURL('My.mov'); ">movie2.SetURL(My.mov)</a><br>
</p>
</body>
</html>
Jan 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin | last post by:
There seems to be some strange behaviour when trying to get the scrollHeight and scrollTop of an iframe in IE6. I have tried several ways of getting these values when the iframe is written into...
1
by: Malkalypse | last post by:
Hello, I have been having some trouble with this one, so I decided to strip it down to its simplest form. I think I found the root of the problem, but I don't know how to solve it. I need a link...
3
by: Quentin | last post by:
Hey there ! I made my own WebControl, that inherits from WebControls, and i added an HtmlTable to it. I would like to include a file, dynamically, to one of its cells... I've already searched,...
3
by: Guadala Harry | last post by:
Here's the functionality I'm after: I need for a page to display a photo. When users click on other links within the page, the photo changes. I'd like to swap out the photo without doing a...
5
by: Angel | last post by:
Is there a way to create an IFRAME dynamically via VB.NET. In other words creating the HTML element in the server side code? thanks in advance....
3
by: synergy_711 | last post by:
I feel like this should be fairly easy but I have been struggling with this for sometime. I have not been able to find someone who's had the same problem as mine yet. ...
5
by: Liquidtouch | last post by:
I'm not much of a HTML or Javascript programmer but have a little experience just hacking away at it. I am creating a HTML application and would like to be able to add or remove rows of a table....
9
by: DL | last post by:
That is, for an iframe with onload attribute to preset a width and height then depending on the length of its content to auto-expand instead of scrolling. The following URL is quite interesting,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.