http://arcgisserverurl/service/{layer1} or http://arcgisserverurl/service/{layer2}Solved! Go to Solution.
<script>
  var serviceURL = "http://arcgisdev01:6080/arcgis/rest/services/Schools_Shared/MapServer/";
  var queryURL;
  //trigger function on load
  //showAlert();
  function getQueryURL() {
   var layerNum = document.getElementById("selectedYear").options[selectedYear.selectedIndex].value;
   queryURL = serviceURL + layerNum;
   //showAlert(serviceURL);
   //fill in text boxes to check my code
   document.getElementById("currentYear").value = layerNum;
   document.getElementById("fullURL").value = queryURL;
  }
  function showAlert() {
   alert(queryURL);
  }
 </script>
 <body>
  <select id="selectedYear" onchange="getQueryURL()">
   <option value="1">Current Year</option>
   <option value="0">Projected Year</option>
  </select>
  
  <input type="text" id="currentYear" size="5">
  <input type="text" id="fullURL" size="60">
  <input type="button"  value="Show URL" onclick="showAlert()">
 </body>
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		