473,722 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error in Firefox loading HTML page into iFrame

2 New Member
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="javascrip t:loadVid('vide o1.html')"><img src="assets/VC01t.jpg" width="97" height="55" border="0" onClick="hidLas tVideoPlayed.va lue='video1.htm l'"/></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.locati on.href = iFrameURL;'
It doesn't load the .html document in the iFrame. I just get the error.
I also get another error:

hidLastVideoPla yed 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 4271
acoder
16,027 Recognized Expert Moderator MVP
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
djlender
2 New Member
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.h tml" target="iFrame" ><img src="assets/VC20t.jpg" width="97" height="55" border="0" /></a>
Jan 18 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
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.h tml" 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 Recognized Expert Moderator MVP
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
4215
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 ifram to a specific url. Here is the code I'm using: <html> <head>
7
13266
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
2489
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: http://easyajax.sourceforge.net/demo/overview.html The page works well in Firefox 1.0.* and IE 6.0, and Opera 8.5, but it doesnt work on Firefox 1.5, the first time you open the page, it works well, but when you refresh the page(such as CTRL-R), the page will displayed in bad way.
8
5369
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 icon on the top corner keeps running with "loading" message on the bottom status bar even though the browser completed everything in the iFrame. The line that causes the problem is "document.close()" in the included JS file. If this line is...
6
4883
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 with the updated links. The list is sometimes long and I would like the user to return to the same iframe anchor point as they were before. I use the following code in the database update script (which also reloads the iframe) which works fine with...
1
8033
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 flash window comes above the iframe area the html links stop working. Yet the links remain active when the flash window is outside the iFrame area. This problem is coming in Firefox, but running fine in IE. If anybody has any solution, please...
4
3872
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 am using a master page senerio. The erro I'm getting is 'busyBox' is not a member of 'ASP.login2_aspx'
7
2227
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 few seconds. As a result I have placed an absolutely positioned <DIVelement that is built into the HTML page that uses an animated GIF and a "Please Wait" message. When the IFRAME finishes loading a javascript function is called to change the...
0
8861
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
8739
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
9383
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
9236
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9088
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
5995
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3207
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
2601
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
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.