473,669 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="JavaS cript"/* 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 \"GeneratePlaye r()\"");
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\"<p aram name=\"src\" value=\"C:\Prog ram
Files\QuickTime \Sample.mov\"<e mbed src=\"C:\Progra m
Files\QuickTime \Sample.mov\" type=\"video/quicktime\"
pluginspage=\"w ww.apple.com/quicktime/download\" name=\"movie1\"
enablejavascrip t=\"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"<ifr ame id="testIframe "
name="testIfram e"></iframe<a
href="javascrip t:GeneratePlaye r();">GenerateP layer()</a><br>
<pMovie1 </p>
</td>
<td width="200"<obj ect
classid="clsid: 02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
id="movie2" height="160" width="180"<par am
name="src" value="C:\Progr am Files\QuickTime \Sample.mov">
<embed src="C:%5CProgr am%20Files%5CQu ickTime%5CSampl e.mov"
type="video/quicktime"
pluginspage="ww w.apple.com/quicktime/download" name="movie2"
enablejavascrip t="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="javascrip t:PlayIt(docume nt.movie1);">Pl ayIt(movie1)</a><br>
<a href="javascrip t:StopIt(docume nt.movie1);">St opIt(movie1)</a><br>
<a href="javascrip t:PlayIt(docume nt.movie2);">Pl ayIt(movie2)</a><br>
<a href="javascrip t:StopIt(docume nt.movie2);">St opIt(movie2)</a><br>
</p>
<p>Control movie by name directly: <br>
<a href="javascrip t:document.movi e1.Play();">mov ie1.Play()</a><br>
<a href="javascrip t:document.movi e1.Stop();">mov ie1.Stop()</a><br>
<a href="javascrip t:document.movi e2.Play();">mov ie2.Play()</a><br>
<a href="javascrip t:document.movi e2.Stop();">mov ie2.Stop()</a><br>
</p>
<p>Replace a movie by name directly: <br>
<a
href="javascrip t:document.movi e1.SetURL('MyOt her.mov');">mov ie1.SetURL(MyOt her.mov)</a><br>
<a
href="javascrip t:document.movi e1.SetURL('My.m ov');">movie1.S etURL(My.mov)</a><br>
<a
href="javascrip t:document.movi e2.SetURL('MyOt her.mov');">mov ie2.SetURL(MyOt her.mov)</a><br>
<a
href="javascrip t:document.movi e2.SetURL('My.m ov');">movie2.S etURL(My.mov)</a><br>
</p>
</body>
</html>

Jan 2 '07 #1
1 14067
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="JavaS cript"/* 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 \"GeneratePlaye r()\"");
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\"<p aram name=\"src\" value=\"C:\Prog ram
Files\QuickTime \Sample.mov\"<e mbed src=\"C:\Progra m
Files\QuickTime \Sample.mov\" type=\"video/quicktime\"
pluginspage=\"w ww.apple.com/quicktime/download\" name=\"movie1\"
enablejavascrip t=\"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"<ifr ame id="testIframe "
name="testIfram e"></iframe<a
href="javascrip t:GeneratePlaye r();">GenerateP layer()</a><br>
<pMovie1 </p>
</td>
<td width="200"<obj ect
classid="clsid: 02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
id="movie2" height="160" width="180"<par am
name="src" value="C:\Progr am Files\QuickTime \Sample.mov">
<embed src="C:%5CProgr am%20Files%5CQu ickTime%5CSampl e.mov"
type="video/quicktime"
pluginspage="ww w.apple.com/quicktime/download" name="movie2"
enablejavascrip t="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="javascrip t:PlayIt(docume nt.movie1);">Pl ayIt(movie1)</a><br>
<a href="javascrip t:StopIt(docume nt.movie1);">St opIt(movie1)</a><br>
<a href="javascrip t:PlayIt(docume nt.movie2);">Pl ayIt(movie2)</a><br>
<a href="javascrip t:StopIt(docume nt.movie2);">St opIt(movie2)</a><br>
</p>
<p>Control movie by name directly: <br>
<a href="javascrip t:document.movi e1.Play();">mov ie1.Play()</a><br>
<a href="javascrip t:document.movi e1.Stop();">mov ie1.Stop()</a><br>
<a href="javascrip t:document.movi e2.Play();">mov ie2.Play()</a><br>
<a href="javascrip t:document.movi e2.Stop();">mov ie2.Stop()</a><br>
</p>
<p>Replace a movie by name directly: <br>
<a
href="javascrip t:document.movi e1.SetURL('MyOt her.mov');">mov ie1.SetURL(MyOt her.mov)</a><br>
<a
href="javascrip t:document.movi e1.SetURL('My.m ov');">movie1.S etURL(My.mov)</a><br>
<a
href="javascrip t:document.movi e2.SetURL('MyOt her.mov');">mov ie2.SetURL(MyOt her.mov)</a><br>
<a
href="javascrip t:document.movi e2.SetURL('My.m ov');">movie2.S etURL(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
24630
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 the html. The following return the correct values in IE6, where the iframe's id is 'f': f.document.body.scrollHeight f.document.body.scrollTop window.frames.document.body.scrollHeight
1
1819
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 in one iframe to open a page in a different iframe. I can do this normally: http://www.jonesmfgmusic.com/test/test1/ But, when the iframes are dynamically generated (created via a
3
5727
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, and found HttpContext.Current.Server.Execute("mapage.aspx") but it executes the page where i call it, and not in the cell... i also tried something like that : MyTable.Rows(0).Cell(0).InnerHtml = Server.Execute("MaPage.aspx") but it doesn't...
3
2977
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 Postback of the entire page. I initially implemented this with an aspx page that contains an IFame which displays only the picture (gif). The behavior was what I wanted, but the problem is that the IFrame does not resize with the photo......
5
9755
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
4981
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. http://g.bach.home.insightbb.com/movies.html I have a page set up on my website to view videos from various sites by creating html pages and creating links to view them inside an iframe. I'm getting tired of creating pages for every video that I find and it seems to make...
5
3203
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. The row that gets added will need to contain 2 columns, 1 which contains an IFRAME, and the other will contain a Javascript Menu which will be used to select the content displayed in the IFRAME. The purpose of the tool is to be used as a video...
9
2526
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, http://www.phpmix.org/iframe_height_auto_resize, however, it failed to work for me, OS = XP w/ sp2; brower = IE7, but my app is quite complicated... it load the iframe inside a javascrip- driven window... And their forum has been closed, so, I...
0
8465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.