BleepingComputer.com: javascript clientHeight (IE6) question

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

javascript clientHeight (IE6) question

#1 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 09 August 2009 - 10:55 PM

Hi,

is there a way to set the document.documentElement.clientHeight property in IE6?

it works fine in firefox (window.innerHeight). I can get the clientHeight in IE6 but everytime i try to set it, it throws an error.

help please

thanks!

by the way, here's the js:
function windowHeight()
{
	var h = document.getElementById('contents').offsetHeight;

	//firefox
	if (typeof (window.innerHeight) == 'number')
	{
		window.innerHeight = h + 24;
	}
	
	//ie
	else
	{
		if (document.documentElement && document.documentElement.clientHeight)
		{
			document.documentElement.clientHeight = h + 24;
		}
		else
		{
			if (document.body && document.body.clientHeight)
			{
				document.body.clientHeight = h + 24;
			}
		}
	}
}


#2 User is offline   KamakaZ 

  • Senior Member
  • PipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 548
  • Joined: 26-August 08
  • Gender:Male
  • Location:Victoria

Posted 10 August 2009 - 01:15 AM

what exactly is it that you are trying to do here? why do you need to set the window size?
If I am helping you and don't reply in 24 hours please send me a PM

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.

#3 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 10 August 2009 - 08:27 PM

it's a popup window. the content of the pop up varies. it looks weird with all the whitespace below if the content doesnt fill the whole window

#4 User is offline   KamakaZ 

  • Senior Member
  • PipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 548
  • Joined: 26-August 08
  • Gender:Male
  • Location:Victoria

Posted 10 August 2009 - 08:43 PM

I haven't had much to do with javascript as i mainly use freely avaliable stuff and mod it, i think this is similar to what you are trying to do?

http://jquery.com/demo/thickbox/ (scroll to bottom to see examples)

http://orangoo.com/labs/GreyBox/

Then again i could be wrong...
If I am helping you and don't reply in 24 hours please send me a PM

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.

#5 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 10 August 2009 - 08:52 PM

although i would love to use that, i cant because i'm opening it in a new popup window, not a pseudo popup :thumbsup:

#6 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 10 August 2009 - 08:53 PM

Quote

it throws an error

Instead of having us guess, don't you suppose it might be helpful if you included the error message?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#7 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 10 August 2009 - 08:59 PM

"object doesn't support this property or method"

firefox doesn't have this error. just ie6. haven't tested it on newer versions of ie.

does that mean, i can get the height of the window but not set it?

This post has been edited by nixx: 10 August 2009 - 08:59 PM


#8 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 10 August 2009 - 09:37 PM

Just off the cuff, it would seem to indicate that IE6 does not support that method. Is there a reason that you absolutely have to support IE6 (me cringes)?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#9 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 10 August 2009 - 10:03 PM

i hate to say it but, REQUIREMENTS haha

oh well. to think this is for an IT company.

#10 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 10 August 2009 - 10:11 PM

Believe me, I understand. There are many corporate entities that will not allow an upgrade of IE, although I could never fathom what they though they would gain by running an 8 year old browser.

If I am guessing cororectly, you have some content of some variable size, that needs to be displayed in a pop-up? What happens if you don't set the size at all?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#11 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 10 August 2009 - 10:22 PM

i couldn't understand it too.

anyway, yeah, the content of the window is varying. i tried removing the dialogHeight, it displayed the popup in a small window. so basically there are scrollbars to view the content

#12 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 11 August 2009 - 09:39 AM

Wait, which method is causing the error?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#13 User is offline   nixx 

  • Forum Regular
  • PipPipPip
  • Find Topics
  • Group: Members
  • Posts: 157
  • Joined: 17-January 06

Posted 14 August 2009 - 02:06 AM

most probably this one:

document.documentElement.clientHeight = h + 24;

i'm guessing you can't set the clientHeight for IE6

#14 User is offline   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 14 August 2009 - 09:44 AM

The thing to do would be to step through the code in a debugger and see for sure.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users