473,799 Members | 3,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Doctype is breaking my iframe in mozilla

8 New Member
This is a problem that i have googled for hours and can't find an answer so i resort to asking on here because i found similar question on here.

I have a page i use, It has an iframe on it but it is not regular iframe, The iframe has a resizing script that resizes the height of the iframe to the height of the page being viewed. Using this script it eliminates scrolling!

This has all been working out great but then i realise for it to function properly in IE i need to add a doctype, When i add a doctype to it it functions properly in IE but it doesn't work in firefox. In firefox the frame doesnt resize and it is like 50px height.
I have tried a bunch of different doctypes and they don't work.

This is the problem page (with doctype - works properly only on IE):
http://ww-chat.com/games.php

This is the page without a doctype (Works properly only on FIREFOX - not IE):
http://ww-chat.com/games-nodoctype.php


This is the code that i use for the iframe:

<iframe id="games" name="games" src="http://ww-chat.com/games/" frameborder=0 scrolling=no width="990" onload="if (window.parent && window.parent.a utoIframe) {window.parent. autoIframe('gam es');}"></iframe>


This is the script that it uses to resize the frame:
http://ww-chat.com/iframeresize.js


I have other iframes on my website which don't use the resize script and they work perfectly fine (with doctype!).

Thanks,
Worldwideebm
Sep 28 '09 #1
10 3453
worldwideebm
8 New Member
Can anyone help me on this problem?
Oct 1 '09 #2
acoder
16,027 Recognized Expert Moderator MVP
You should look at getting rid of these errors.

Anyhow, the problem seems to be because you've forgotten the units when setting the height. Add "px" to the height setting.
Oct 1 '09 #3
worldwideebm
8 New Member
Hey, I'm not very good at this but where exactly should I put px?

I have tried placing it after 990 (the width) and i have tried placing px after 10 (in the script) and neither of those fixed it.

Any ideas?

Btw the resize script isn't mine..
Oct 1 '09 #4
Dormilich
8,658 Recognized Expert Moderator Expert
@worldwideebm
every numerical value (except 0) requires a unit in CSS.
Oct 1 '09 #5
worldwideebm
8 New Member
I have tried putting px after both numbers and it doesn't fix. I don't know what could cause this, it only happens when i put the doctype in (because it wont work in IE without doctype, but the height doesn't work in firefox if i use doctype) I don't use CSS for anything on the iframe so it can't be css.

Here is what my iframe page is:

<iframe id="games" name="games" src="http://ww-chat.com/games/" frameborder=0 scrolling=no width="990px" onload="if (window.parent && window.parent.a utoIframe) {window.parent. autoIframe('gam es');}"><p>Your browser does not support Iframes, People upgrade to a compatible browser.</p></iframe>
Here is the script that resizes my iframe:
function autoIframe(fram eId){
try{
frame = document.getEle mentById(frameI d);
innerDoc = (frame.contentD ocument) ? frame.contentDo cument : frame.contentWi ndow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.hei ght = innerDoc.body.s crollHeight + 10px;
}
catch(err){
window.status = err.message;
}
}

Any ideas why it wouldn't work?
Oct 1 '09 #6
Plater
7,872 Recognized Expert Expert
Neither of those two links in the first post worked for me in IE or in FF.
Your javascript has errors.
Expand|Select|Wrap|Line Numbers
  1. Error: missing ; before statement
  2. Source File: http://ww-chat.com/iframeresize.js
  3. Line: 6, Column: 50
  4. Source Code:
  5. objToResize.height = innerDoc.body.scrollHeight + 10px; 
  6.  
Expand|Select|Wrap|Line Numbers
  1. Error: initMenu is not defined
  2. Source File: http://ww-chat.com/games-nodoctype.php
  3. Line: 3
  4.  
Try doing this:
objToResize.hei ght = (innerDoc.body. scrollHeight + 10)+"px";
Oct 1 '09 #7
worldwideebm
8 New Member
THANK YOU SO MUCH!
That worked! =]

Thanks to every who replied =]
Oct 1 '09 #8
Plater
7,872 Recognized Expert Expert
Now both your links work in IE and FF.
All fixed?
Oct 1 '09 #9
worldwideebm
8 New Member
Yes =]

But there is another problem.. But i might start a new thread for it?

I don't think that it is related to this problem..
Oct 1 '09 #10

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

Similar topics

1
5965
by: Jeff Thies | last post by:
I'm (still) having trouble reading the contents of an IFRAME (IE5). I have this: var my_iframe = document.frames; What I would want to do at that point is get either the contentWindow.document or the contentDocument depending on whether this was IE or Mozilla. (Thanks Lasse.) I'm not finding this.
3
18703
by: alejandro.rivero | last post by:
In Mozilla, the following code seems to resize correctly the IFRAME, so no scroll bars: <iframe marginwidth=0 marginheight=0 src=text.html onload="this.height= this.contentDocument.height"> </iframe> Of course a frameborder=0 can be desiderable too :-)
6
5168
by: Patrick | last post by:
Hi I am fairly new to CSS and the web.I am trying to build a site more to practice my skills than for the site itself. I have been focusing on CSS and try my best to make it work in I.E 6.0, Opera 7.23, Mozilla 1.4 and N.N. 7.1. My site was doing fine until i read i was supposed to keep everything validated so i entered a strict html 4.01 doctype with url following.My HTML validated fine. So i validated my CSS and beside a little...
2
3988
by: swathi | last post by:
----------------------------------------------------------------------- A poll associated with this post was created, to vote and see th results, please visit http://www.forum4designers.com/message103437.htm ----------------------------------------------------------------------- Question: iframe onfocus problem in mozilla browse - attached zip fil - multi.html in attached zi...
6
11064
by: Randell D. | last post by:
Folks, I've spent the past hour or so testing IFRAME with Mozilla 1.7.5 and not getting it to work - Then... I thought I'd try it in IE, and my code worked... Thus... is IFRAME an IE only feature? I use Mozilla most often and I am nearly sure that I have used a website that had an IFRAME like window... is there another method?
16
7119
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe"); MyDiv.appendChild(iframeObject); var data = "<html><head><title>testing</title></head><body>data</body></html>" iframeObject.contentDocument.open(); iframeObject.contentDocument.writeln(data);
22
8018
by: stevenkobes | last post by:
If a word has a hyphen in it, IE will permit a line break at the hyphen, but Firefox/Mozilla won't. Apparently the Firefox behavior is standards-compliant, but it is not what I want. Is there a way to denote a hyphen in HTML, that the line can be broken after? I've read some stuff about soft hyphens and non-breaking hyphens, but those seem like the opposite of what I'm looking for. I want a normal hyphen, that always appears, and I...
14
18293
by: Aaron Gray | last post by:
Hi, I want to access the properties of an IFrame but seem unable to get access to the IFrames document body. <html> <body> <iframe src="test.html" id="IFrame"></iframe> </body>
3
1701
by: tullyrob | last post by:
If you run the following simple line of code in Mozilla the webpage loads fine. However, a default page is displayed when opened in IE. --- <html> <iframe name=stbbox src="http://www.thegreatproduct.com" width="700" height="700"></iframe> </html> --- I posted this in the Java section because I suspect the problem can be overcome with Java. I am a novice at Java but I think the webpage needs to get a cookie? Can anyone please explain why...
0
9687
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
10485
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...
1
10231
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
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();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
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
3
2938
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.