Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror

Comment To make it work in IE, catch an exception (Score 1) 528

Had a "bug" yesterday in IE (which threw no errors) and finally found this on w3c schools as the official example of how to add a select option.  I wonder if they were trying to be funny in subtle way.

<script type="text/javascript">
function insertOption()
  {
  var y=document.createElement('option');
  y.text='Kiwi'
  var x=document.getElementById("mySelect");
  try
    {
    x.add(y,null); // standards compliant
    }
  catch(ex)
    {
    x.add(y); // IE only
    }
  }
</script>

Slashdot Top Deals

"Truth never comes into the world but like a bastard, to the ignominy of him that brought her birth." -- Milton

Working...