Javascript Ajax

Standard
<script type="text/javascript">
			
		function getHTTPObject(){
			var xmlhttp;
			// Attempt to initialize xmlhttp object
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e) {
				// Try to use different activex object
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (E) {
					xmlhttp = false;
				}
			}
			// If not initialized, create XMLHttpRequest object
			if (!xmlhttp) {
				if (typeof XMLHttpRequest != 'undefined') {
					xmlhttp = new XMLHttpRequest();
				}
				else {
					alert("This browser does not support AJAX.");
					return null;
				}
			}
			return xmlhttp;
		}
		 
		function loadTask (id,list) {
			httpObject = getHTTPObject();
			if (httpObject != null) {
				httpObject.open("GET", "<?php echo base_url(); ?>project/timesheet/task/"+id, true);
				httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				httpObject.setRequestHeader("Connection", "close");
				httpObject.onreadystatechange = function() {
		
						if (httpObject.readyState == 4) {
							if (httpObject.responseText == "") {
								document.getElementById('task'+list).innerHTML = 'No Task';
							}
							else {
								document.getElementById('task'+list).innerHTML = httpObject.responseText;
							}
						}
						else {
							document.getElementById('task'+list).innerHTML = 'Loading Task...';
						}
								
					}
				httpObject.send();
			}
		}

		</script>