User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 392,047 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,290 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1147 | Replies: 3 | Solved
Reply
Join Date: Apr 2008
Posts: 2
Reputation: kickinmhl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kickinmhl kickinmhl is offline Offline
Newbie Poster

Iframe / firefox issue

  #1  
Apr 16th, 2008
I am having this compatibility probelm with IE vs. Firefox. The below code works perfectly fine in IE but not in Firefox.

Essentially it is a pair of radio buttons and an Iframe below it. I want the Iframe content to change when the radio button option is selected. the initial page displays fine on load, but the radio buttons do not change the content in firefox, it does in IE

Any idea what I am doing wrong here?
Thanks for your help


<html>

<head>
<title>Title here</title>

<script type="text/javascript">
function changeIframeSrc(result)
  {
  	var ilone = document.getElementById("I1");
  	if( ilone && ilone.src)
  	{
  		ilone.src=result;
  	}
  }
  
</script>
</head>
<body>
<h1>Header here:</h1>

<form>
<input type="radio" name="result" onclick="changeIframeSrc(this.value)" value="Subfolder1/index.htm">Radio button option 1<br />
<input type="radio" name="result" onclick="changeIframeSrc(this.value)" value="Subfolder2/index.htm">Radio button option 2<br />
</form>

<iframe name="I1" src="InstallNewport/index.htm" width="95%" height="500">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>

</body>

</html>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,775
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Iframe / firefox issue

  #2  
Apr 16th, 2008
You are doing a getElementById() for "I1" but there is no element which goes by the ID "I1"; you only have an IFRAME with a name attribute of "I1". IE is infamous for allowing such things to slip by. If a call to getElementById() returns null, it looks for an element with the same name and if found; uses that. I am pretty sure your code would have failed even in Opera or any decent browser out there.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Apr 2008
Posts: 2
Reputation: kickinmhl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kickinmhl kickinmhl is offline Offline
Newbie Poster

Re: Iframe / firefox issue

  #3  
Apr 16th, 2008
Well.....I'm an idiot!
Sorry, and thanks. glossed right over that.

Thanks again
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,775
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Iframe / firefox issue

  #4  
Apr 16th, 2008
You are welcome. :-)

BTW, if your question is answered, please mark the thread as solved by clicking on the link 'Mark As Solved' so that it becomes easy for others who use the search feature of this forum to find solution to their problems.
Last edited by ~s.o.s~ : Apr 16th, 2008 at 4:02 pm.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC