rootmeanclaire
rootmeanclaire

Reputation: 838

Uncaught SyntaxError: Unexpected end of input on line one

This error is usually associated with messy close parens, but I'm getting the error on line 1 of the file!

Here's the javascript(filename: calculate.js)

var colors = new Array();
colors["SILVER"]    = -2;
...

There's plenty more code later in the file, but I don't think it could be causing this error.

And in case this is caused by the head declarations, here's the document head.

<meta id="author" content="Dawson Diaz, Evan Shimoniak">
<meta id="description" content="Resistor Color Code Calculator">
<meta id="keywords" content="Resistor, Calculator, Color Code, Electronics">
<!--Set favicon-->
<link href="favicon.ico" rel="icon" type="image/x-icon" />
<!--Include jQuery-->
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<!-- Latest Bootstrap minified CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<!-- Custom CSS -->
<link rel="stylesheet" href="style.css">
<!--Latest compiled and minified Bootsrap JavaScript-->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!--Calculator-->
<script src="calculate.js" type="text/javascript"></script>
<!--Input processing-->
<script src="ui.js" type="text/javascript"></script>

Any advice is appreciated.

EDIT: The full code for calculate.js is here

Upvotes: 2

Views: 10816

Answers (1)

dave
dave

Reputation: 64657

You're missing a } at the end of your getResistanceStr function. Don't know why it says line 1 but that is the problem.

Upvotes: 1

Related Questions