| | |
Iframe / firefox issue
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2008
Posts: 2
Reputation:
Solved Threads: 0
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
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
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<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>
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.
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.
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 5:02 pm.
I don't accept change; I don't deserve to live.
![]() |
Similar Threads
- iframe not working in IE, works fine in Firefox (JavaScript / DHTML / AJAX)
- Opera Javascript bug? (works in Firefox) (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Using a popup to fill an input field
- Next Thread: Any pointer on how the developer made this
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxjspservlets array browser bug captchaformproblem cart checkbox child class close codes createrange() css cursor date debugger decimal dependent design disablefirebug dom dropdown editor element embed engine enter error events explorer ext file firefox focus form forms frameworks getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe images index internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl listbox maps masterpage math media menu mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent paypal pdf php position post problem programming progressbar prototype redirect runtime safari scale scriptlets scroll search security shopping size software toggle unicode w3c web wysiwyg \n






