473,386 Members | 1,867 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,386 software developers and data experts.

Error in Firefox loading HTML page into iFrame

Hi All!
I'm hoping someone can help me with this situation. I am a developer working on a project that has a video voting page.
The situation is this:
The parent page has an iFrame ( named iFrame1 ) and it is supposed to load in an external .html page that has a flash video in it. The external .html page is supposed to load when a user clicks on a thumbnail image on the parent page. There are 20 external .html pages that a user can load in by clicking on the associated thumbnail on the parent page. I am using JavaScript to tell it to load the next .html page because the parent page has .asp code in it for a voting mechanism.
The code for the thumbnail is:

[HTML]<div align="left">
<a href="javascript:loadVid('video1.html')"><img src="assets/VC01t.jpg" width="97" height="55" border="0" onClick="hidLastVideoPlayed.value='video1.html'"/></a>
[/HTML]
The JavaScript code in the external file ( iFramevid.js ) is:

Expand|Select|Wrap|Line Numbers
  1. function loadVid(iFrameURL)
  2. {
  3.     iFrame1.location.href = iFrameURL;
  4.  
  5. }
  6.  
This all works great in Internet Explorer but when I try it in Firefox I get an error:
"iFrame1 is not defined" and it shows the line 'iFrame1.location.href = iFrameURL;'
It doesn't load the .html document in the iFrame. I just get the error.
I also get another error:

hidLastVideoPlayed is not defined
loadVid("video3.html")

Does anyone know how to get around this or fix it? I'm perplexed. It would be one thing if it didn't work in IE.
Thanks in advance!

djlender
Jan 17 '08 #1
4 4249
acoder
16,027 Expert Mod 8TB
You have to access the iframe properly using document.frames["iFrame1"]. IE allows you to access by name/id globally, but that's incorrect.
Jan 18 '08 #2
You have to access the iframe properly using document.frames["iFrame1"]. IE allows you to access by name/id globally, but that's incorrect.
You are quite correct. I just figured that out with the help of a couple fellow co-workers. The new code that seems to work is:
<a href="video20.html" target="iFrame"><img src="assets/VC20t.jpg" width="97" height="55" border="0" /></a>
Jan 18 '08 #3
acoder
16,027 Expert Mod 8TB
You are quite correct. I just figured that out with the help of a couple fellow co-workers. The new code that seems to work is:
<a href="video20.html" target="iFrame"><img src="assets/VC20t.jpg" width="97" height="55" border="0" /></a>
Yes, that should work because you're targetting the iframe by name.
Jan 18 '08 #4
acoder
16,027 Expert Mod 8TB
You have to access the iframe properly using document.frames["iFrame1"]. IE allows you to access by name/id globally, but that's incorrect.
Just noticed the document.frames. That should, of course, be window.frames[].
Jan 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jim Marquardson | last post by:
Hi, I've struggled with this for a while now, so I'm asking for help. I am trying to click on a link in one page, have that link open up in a new window, and set that newly opened window's...
7
by: WH | last post by:
<html> <head> <style type="text/css"> html, body { overflow: hidden; } </style> </head> <body onload="showit()" leftMargin="0" rightMargin="0" topMargin="0"
12
by: wangzx | last post by:
I am the author of easyajax.sourceforge.net, and I have a problem on Firefox 1.5, I post the problem here and hopes somebody help me. The test page can be:...
8
by: hyejin | last post by:
I have a problem with dynamic iframe and document.close() on Firefox. Below two files create a dynamic iframe by JavaScript. These two samples do not have any problems on IE. But, on Firefox, the...
6
by: Raffi | last post by:
Hi, My web page has an iframe with a list of items from a database. These items are html links and when clicked they execute a server side script to update the database and reload the iframe...
1
by: Sura | last post by:
Hi I have a flash interactive window which has html links and this appears on an html page. This window can be moved with the mouse on the html page. The html page has an iFrame too. When the...
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
7
by: John Kotuby | last post by:
Hi all, I have created an ASPX page in VS 2008 that appears inside of an IFRAME inside a standard HTML page. Because it loads from an external site and is database driven, the first load takes a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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.