View Full Version : Cannot set height property with variable

10-31-2008, 07:18 AM

I read the height querystring value from a url in an .aspx page via javascript.

I use the following javascript to read the height value:

<script type="text/javascript" language="javascript">

var params = window.location.search.substring(1).split( '&' );
var iheight;

for( var i = 0, l = params.length; i < l; ++i )
var parts = params[i].split( '=' );
switch( parts[0] )
case 'height':
iheight = parseInt( parts[1] );
//iheight = 2000;


I have an iframe on the same page and I want to set the height of the frame to the height of the iheight variable

<iframe src="link to page" id="searchIFrame" width="600" height="400" scrolling="auto" frameborder="1"></iframe>

The problem that I have is that as soon as I hard code the iheight = 2000; variable then the frame grows, but when I use the variable from the querystring then I cannot set the height property. In other words:

Is NOT working

, but

Is working

All I am trying to achieve is to set the height property of an inline frame when the form loads using a variable that I set getting the value from a querystring.

Is there maybe there is another way to do this?

Please help?


10-31-2008, 07:50 AM
How about


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum