Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had created a application using ArcGIS API for JS to geolocate features in the feature layer that is added to basemap. I have an external Javascript and css file that are referenced (called) to html file. When I tried to run the html from web server it is sending an error message (script.js:1 Uncaught SyntaxError: Unexpected token <) for first line of JS file.

I re-checked my scripts couple of times, but I couldn't find any mistake in it. Is there anything wrong with Javascript syntax? Please check the below scripts:


<script src=""></script>

var map;


function(Map, FeatureLayer, Search) {       
    map = new Map("mapDiv", {       
        basemap: "streets",        
        center: [-56.049, 38.485],
        zoom: 3,

    var Search = new Search({
        allPlaceHolder: "Find by address",    
        autoNavigate: false,
        autoSelect: false,
        enableHighlight: true,
        enableInfoWindow: true,
        enableSearchingAll: true,
        showInfoWindowOnSelect: true,
   },"Address"); });



    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>Geolocating parcels</title>
<link rel="stylesheet" type="text/css" href="">
    <link rel="stylesheet" type="text/css" href="">
    <script src=""></script>
    <link rel ="stylesheet" href ="styles.css">

  <div id = "mapDiv" style="position: relative; width:50px; height:50px; border:1px solid #000;"></div>
  <div id = "Address">  </div>  

  <script src="script.js" type ="text/javascript" ></script>
  <script src=""></script>
share|improve this question
up vote 2 down vote accepted

I believe it is a problem with your call to the script, i think if you remove the duplicates you will fix your problem.

share|improve this answer
Thank you! I fixed. – Mukhtar Ahmed Jan 8 at 18:18
  1. You're calling <script src=""></script> multiple times in your HTML file.
  2. You can't use <script> HTML tags inside your .js file.
share|improve this answer
Thank you. I fixed. – Mukhtar Ahmed Jan 8 at 18:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.