Basic problem - external js files

javascript

#1

I’m having difficulty with embedding a js file. I have both a direct reference to the file, and also a reference to it in a path. Neither are working. Project links below, code below that.

I’ve been looking through the forum here for a while but haven’t found anything that’s helped yet. Any help is appreciated!


Links
Editor: https://ide.c9.io/mmc/d3-test
Application: https://d3-test-mmc.c9users.io
Files: https://preview.c9users.io/mmc/d3-test

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  	<head>
    	<meta charset="UTF-8">
    	<title>d3.js gauges</title>
		
 <style>
		
			body
			{
			  	font: 10px arial;
			}
			
		</style>
		

		<script>
						
			var gauges = [];
			
			function createGauge(name, label, min, max)
			{
				var config = 
				{
					size: 120,
					label: label,
					min: undefined != min ? min : 0,
					max: undefined != max ? max : 100,
					minorTicks: 5
				}
				
				var range = config.max - config.min;
				config.yellowZones = [{ from: config.min + range*0.75, to: config.min + range*0.9 }];
				config.redZones = [{ from: config.min + range*0.9, to: config.max }];
				
				gauges[name] = new Gauge(name + "GaugeContainer", config);
				gauges[name].render();
			}
			
			function createGauges()
			{
				createGauge("memory", "Memory");
				createGauge("cpu", "CPU");
				createGauge("network", "Network");
				//createGauge("test", "Test", -50, 50 );
			}
			
			function updateGauges()
			{
				for (var key in gauges)
				{
					var value = getRandomValue(gauges[key])
					gauges[key].redraw(value);
				}
			}
			
			function getRandomValue(gauge)
			{
				var overflow = 0; //10;
				return gauge.config.min - overflow + (gauge.config.max - gauge.config.min + overflow*2) *  Math.random();
			}
			
			function initialize()
			{
				createGauges();
				setInterval(updateGauges, 5000);
			}
			
		</script>
		
		
	</head>
	
	<body onload="initialize()">
		<p>FFS world</p>
		<span id="memoryGaugeContainer"></span>
		<span id="cpuGaugeContainer"></span>
		<span id="networkGaugeContainer"></span>
		<span id="testGaugeContainer"></span>
	
		<script src="https://mbostock.github.com/d3/d3.js"></script>
		<script src="js/gauge.js"></script>
		<script src="gauge.js"></script>

	</body>
	
</html>