AnsweredAssumed Answered

creating javascript external file for map function

Question asked by MayMay on Sep 17, 2014
Latest reply on Sep 17, 2014 by Paulcrickard

I try to create a simple javascript external file.  I put all the require & function in one js file, it works. But how do you create another external js file for map function.

<!DOCTYPE html>
    <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>Simple Map</title>
    <link rel="stylesheet" href="">
    <link rel="stylesheet" href="css/layout.css">
    <script src=""></script>
    <script type="text/javascript" src="script/init.js"></script>

    <div id="map"></div>






      html, body, #map {

        height: 100%;

        width: 100%;

        margin: 0;

        padding: 0;


      body {

        background-color: #FFF;

        overflow: hidden;

        font-family: "Trebuchet MS";






      var map;

      require(["esri/map", "dojo/domReady!"],function(Map) {
  map = new Map("map", {
          basemap: "topo",
          center: [-122.45, 37.75], // longitude, latitude
          zoom: 13


Thank you.