Can't get started with Internet Explorer

1572
6
06-07-2017 08:59 AM
JoeLuchette
New Contributor

Hi Everyone, Im hoping this is an easy one. So, Im just getting started on a simple little webpage using 4.3, and using some sample code from the getting started API webpage (see below) and I can't get even an unmodified sample working locally in IE 11. 

When i first load it i get a popup sauing blocked content for active X control. So I click to allow the content, then i get nothing. Debugger shows "Access is denied." on line 18 of file 4.3.So im not getting far. 

Any ideas? Thanks in advance.

Heres the example html from the getting started, unmodified as im trying to load it. 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Get started with MapView - Create a 2D map</title>
<style>
html, body, #viewDiv {
padding: 0;
margin: 0;
height: 100%;
width: 100%;
}
</style>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
<script>
require([
"esri/Map",
"esri/views/MapView",
"dojo/domReady!"
], function(Map, MapView){
var map = new Map({
basemap: "streets"
});
var view = new MapView({
container: "viewDiv", // Reference to the scene div created in step 5
map: map, // Reference to the map object created before the scene
zoom: 4, // Sets the zoom level based on level of detail (LOD)
center: [15, 65] // Sets the center point of view in lon/lat
});
});
</script>
</head>
<body>
<div id="viewDiv"></div>
</body>
</html>

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Joe,

   You can not run the html using a local path like "C:\JS_Workspace\IE1143.html" you need to run it through you local web server for it to work. i.e. http url.

JoeLuchette
New Contributor

Thanks everyone, I did not think i had to use IIS for this simple application development. I will have to find a home to host this webpage eventually but was just building it locally without IIS.

The insight is much appreciated. 

0 Kudos
ThomasSolow
Occasional Contributor III

I can open that sample just fine with something like file:///home/XXX/Desktop/index.html in chrome.

I agree with Robert though: you'd normally want to host the file locally and access it via localhost.  Accessing it from a path to a file limits what you can do in terms of http requests.

ChrisSmith7
Frequent Contributor

Joe,

Are you using IIS or an open source web server? We can provide some documentation on getting that rolling, if you need it.

MirHashmi
Occasional Contributor

IE doesn't allow to open files locally. It has to be hosted on a web server either locally or on a remote server.

Whereas, chrome allows to open files locally.

SteveCole
Frequent Contributor

It's really not a big deal to install IIS on your machine to create a Localhost "server". I've done this at home and it works fine.

0 Kudos