tags:

views:

148

answers:

2

Hi,
i know, this is a realy popular error. But my problem is that my script is over 1.500 lines big.

What can i do? .... or ... what are you going to do?

Thanks in advance!
Peter

EDIT:

jQuery.extend({
    style: function( elem, name, value ) {
        // don't set styles on text and comment nodes
        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
            return undefined;
        }

        // ignore negative width and height values #1599
        if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
            value = undefined;
        }

        var style = elem.style || elem, set = value !== undefined;

        // IE uses filters for opacity
        if ( !jQuery.support.opacity && name === "opacity" ) {
            if ( set ) {
                // IE has trouble with opacity if it does not have layout
                // Force it by setting the zoom level
                style.zoom = 1;

                // Set the alpha filter to set the opacity
                var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
                var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
                style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
            }

            return style.filter && style.filter.indexOf("opacity=") >= 0 ?
                (parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
                "";
        }

        // Make sure we're using the right name for getting the float value
        if ( rfloat.test( name ) ) {
            name = styleFloat;
        }

        name = name.replace(rdashAlpha, fcamelCase);

        if ( set ) {
            style[ name ] = value; // <<------------------ invalid argument
        }

        return style[ name ];
    },

i get this error "invalid argument" when i start the page.

+3  A: 

try this bit of code vs. the line you have:

//yours
if ( set ) {
  style[ name ] = value; // <<------------------ invalid argument
}

// swap it out with this...
if ( set ) {
  try{
    style[ name ] = value;
  } catch(ex){
    alert('Caught Exception attempting to set: [' + name + '] to [' + value + ']');
  }
}

I can only guess that the name you are trying to use is not one IE will allow. If this is the case, wrapping it in a try/catch will show you which property. (after that you can either ignore the error (if truly irrelevant) or gracefully set some alternative way.

scunliffe
Ok, i get this error. "Caught Exception attemting to set [marginLeft] to [-NaNpx]"
Peter
Thank you very very much!
Peter
no problem! - glad to help.
scunliffe
A: 

Hi i am getting the same exception "Caught Exception attempting to set: [left] to [NaNpx]", i am trying to use jScrollPane on an innerdiv, i am also resizing the outer div with jquery,

resizing the content div var contentCss = { 'width' : contentwidth+10, 'height' : contentheight, 'top' : contenty, 'left': contentx } $("#content").css(contentCss);

it would be great if you could help me out.

Mohammed Ali