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.

Photo

javascript clientHeight (IE6) question


  • Please log in to reply
13 replies to this topic

#1 nixx

nixx

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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;
			}
		}
	}
}


BC AdBot (Login to Remove)

 


#2 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:06:44 AM

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?

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 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:06:44 AM

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...

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 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:44 PM

Posted 10 August 2009 - 08:53 PM

it throws an error

Instead of having us guess, don't you suppose it might be helpful if you included the error message?

#7 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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?

Edited by nixx, 10 August 2009 - 08:59 PM.


#8 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:44 PM

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)?

#9 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:44 PM

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?

#11 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:44 PM

Posted 11 August 2009 - 09:39 AM

Wait, which method is causing the error?

#13 nixx

nixx
  • Topic Starter

  • Members
  • 159 posts
  • OFFLINE
  •  
  • Local time:03:44 AM

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 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:44 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users