Q:

Pass a string literal from html to a javascript function

In IE9 I am getting an error Microsoft JScript runtime error: 'populatedropdown' is undefined on the line <input type="button"....
I assume I am not escaping the literal values correctly.  How should I change?
<html>
<head>
<title>Add items to dropdown</title>

<script type="text/javascript">
function populatedropdown(var devicelist) {
    var devList = document.frm.optdevices;
    var arrDev = split(devicelist, ";");

     devList.options.length = 0; // this removes existing options

     for (var i = 0; i <= 3; i++) {
         var option = new Option(arrDev[i],i);
         devList.options[i] = option; 
     }
}

</script>

</head>
<body>
<form name="frm">

<select name="optdevices">
</select>

<input type="button" value="TestAdd" onclick="populatedropdown('201;202;203;')" />

</form>
</body>
</html>

A:

First, you should not write var via defining function, and second use of function split is wrong, split should be used like 
var result = strToSplit.split(";"), if you wanna split by ; , you can read about split here Javascript Split method
here is working snippet
function populatedropdown(devicelist) {
    var devList = document.frm.optdevices;
    var arrDev = devicelist.split(";");

     devList.options.length = 0; // this removes existing options

     for (var i = 0; i <= 3; i++) {
         var option = new Option(arrDev[i],i);
         devList.options[i] = option; 
     }
}

just tested on IE9

