473,404 Members | 2,174 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,404 software developers and data experts.

problem of Firefox support for resize iframe's height javascript

Hi everyone, anyone please kindly help me check out the javascript below? The code run well for IE but do not work on firefox. while on firefox, it promt error of "obj has no properties". I think it may be the syntax that not supported on firefox, but i do not know what the syntax suppose for firefox. Could anyone expert in javascript lend me a hand? Thanks in advance, this is quite urgent...please help!



Expand|Select|Wrap|Line Numbers
  1.        function reloadparent()
  2.         {
  3.             autoResizeObject(self.parent.document.getElementById('modelFrame'));
  4.             autoResizeObject(self.parent.parent.document.getElementById('productFrame'));
  5.         }
  6.  
  7.         function autoResizeObject(obj)
  8.         {
  9.             var newheight;
  10.             var newwidth;
  11.             if(document.getElementById){
  12.                 newheight=obj.contentWindow.document.body.scrollHeight;
  13.                 newwidth=obj.contentWindow.document.body.scrollWidth;
  14.             }
  15.             obj.style.height= (newheight+10) + "px";
  16.             //obj.style.width= (newwidth) + "px";
  17.         }     
[HTML]<body onload="reloadparent();" >[/HTML]
Mar 10 '08 #1
1 1792
acoder
16,027 Expert Mod 8TB
Show the HTML for the iframe. Do the IDs match?
Mar 10 '08 #2

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

Similar topics

1
by: khothikhe | last post by:
Can someone help me here because this is really killing me! the problem is, i have this javascript code in my aspx page that i want it to work on almost all browsers, especially opera and safari...
3
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.....
1
by: sam | last post by:
Hi all, Hope some expert can help me resolve this. I am using the following code to resize an iframe according to the content in it so that the iframe does not use its scroll bar and uses the...
1
by: Dave | last post by:
Usual apologies if this is old territory. I'm resizing a bunch of iframes on a page to the height of their contained documents. Some of the contained documents contain IMG tags. On IE this...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
13
by: bgraphics2031 | last post by:
I'm trying to get this iframe to dynamically resize by dragging a vertical bar, but it's not working in Mozilla (It originally worked in IE but I've been trying to port it over). Any help will be...
1
by: SunshineInTheRain | last post by:
My project has 3 files, File1 has included master page. file1 consists of iframe1 that load file2. File2 consists of iframe2 that load file3. Javascript used on each file to resize the iframe...
11
by: Stevo | last post by:
I have a problem with Firefox 2 where if I resize the height of a DIV (using JavaScript), but the rest of the page below isn't being updated to reflect the new positions that affected items should...
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: 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: 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
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,...
0
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.