Question : Jquery javascript error

Experts,

Whilst running my application in Internet Explorer 8 I noticed a Javascript error which was preventing scripting from continuing.  Running the debugger identified an issue with a line in Jquery framework (Code below) pointing to an issue setting an element to a value.  After looking futher I could see that the value was "-18px" of type string.  Adding an if clause to check for this value works, however I'm concerned that other 'negative' values may get passed in the future.  

Could anyone help create a regular expression to check for this?



1:
2:
3:
4:
if ( set )
{
    elem[ name ] = value;	
}

Answer : Jquery javascript error

Why a regex ?

1:
2:
3:
4:
if ( set.indexOf("-")>=0 )
{
    elem[ name ] = value;	
}
Random Solutions  
 
programming4us programming4us