Friday, May 4, 2012

Firefox Error in parsing value for 'height'. Declaration dropped

I have developed Java Script to find the height of columns height and make it match for all columns in the web page but I was getting an  error “Error in parsing value for 'height'.  Declaration dropped” in the Firefox but in IE it is working fine without issue, then we I cross checked the script I found the issue I forget to define the unit of measure, so I just added the unit of measure and this issue resolved, following the old code and new code.

Old Code
   function msetcontainer() {
        if (document.getElementById) {
            var windowHeight = getWindowHeight();
            if (windowHeight > 0) {
                var contentHeight =
        document.getElementById('rightcol').offsetHeight;
                var contentID = document.getElementById('rightcol');

                var LeftcontentHeight =
        document.getElementById('leftcol').offsetHeight;
                var LeftcontentID = document.getElementById('leftcol');
                if (LeftcontentHeight != contentHeight) {
                    contentID.style.height = LeftcontentHeight;
                }
            }
        }
    }

New Code
   function msetcontainer() {
        if (document.getElementById) {
            var windowHeight = getWindowHeight();
            if (windowHeight > 0) {
                var contentHeight =
        document.getElementById('rightcol').offsetHeight;
                var contentID = document.getElementById('rightcol');

                var LeftcontentHeight =
        document.getElementById('leftcol').offsetHeight;
                var LeftcontentID = document.getElementById('leftcol');
                if (LeftcontentHeight != contentHeight) {
             //there was issue with firefox becasue i forget to add + 'px'
                    contentID.style.height = LeftcontentHeight + 'px' ;
                }
            }
        }
    }

No comments:

Post a Comment

SSRS - How to Parameterizing the SQL Query

We need to create separated dataset to handle the pre defined list in that dataset we will use simple select statement to define the li...