document.getElementById not working in FireFox
-
- Posts: 12
- Joined: April 1st, 2009, 4:41 am
Re: document.getElementById not working in FireFox
when i assign the same id to both inner and outer object, the page doesnt read the inner object in FF but in IE it runs the outer one fine, in FF its not even showing the flash so not reading the inner one..
-
- Posts: 12
- Joined: April 1st, 2009, 4:41 am
Re: document.getElementById not working in FireFox
if you check this updated zip file, you will see lot of attempts on getting the value in the flash on FIREFOX, but none of it worked out, please check if you can:
http://www.showtimearabia.com/test/Var/2Objects1ID.zip
Thanks
F.
http://www.showtimearabia.com/test/Var/2Objects1ID.zip
Thanks
F.
- jscher2000
- Posts: 11742
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
Re: document.getElementById not working in FireFox
You cannot use the same id for two different elements; id must be unique. Since Firefox is assigning the id to the outer <object> then it is not available to identify the inner object, which is the one that actually can work in Firefox.
Since you are using SWFObject, why not let it create one and only one <object> for you? I think that's what it was designed for. Hopefully then you won't have this problem of two <object>s and everything will work as expected.
Since you are using SWFObject, why not let it create one and only one <object> for you? I think that's what it was designed for. Hopefully then you won't have this problem of two <object>s and everything will work as expected.
-
- Posts: 12
- Joined: April 1st, 2009, 4:41 am
Re: document.getElementById not working in FireFox
hi
The issue has been resolved, the changes were required in the java script as its using the SWFOBJECT, here is the working code below:
Thanks everyone for helping me out!!!
Fahad.
The issue has been resolved, the changes were required in the java script as its using the SWFOBJECT, here is the working code below:
Code: Select all
<script type="text/javascript">
swfobject.registerObject("myID", "8.0.0");
window.onload = function CountryCode() {
var obj = swfobject.getObjectById("myID");
if (obj && typeof obj.SetVariable != "undefined") {
obj.SetVariable("VariableinFlash", "Value");
}
};
</script>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="268" height="246" id="myID" name="myID">
<param name="movie" value="mySWF.swf?" />
<param name="menu" value="false" />
<!--[if !IE]>-->
<object name="myID" type="application/x-shockwave-flash" data="mySWF.swf?" width="268" height="246">
<param name="swliveconnect" value="true" />
<!--<![endif]-->
<!--Non Flash Announcement-->
Alternate Content Here
<!--Non Flash Announcement-->
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
Thanks everyone for helping me out!!!
Fahad.