Select to view content in your preferred language

Cannot read property 'toLowerCase' of null

5893
2
Jump to solution
05-19-2017 08:31 AM
SaraEL_MALKI
Frequent Contributor

Hi guys,

I am facing the error "Cannot read property to lower case of null"  each time I reload the page and it solves when I refresh it, sometimes it takes several attempts to load the map and everything related to the arcgis API, ( the error is in the image below) ,I've heard it's because of the order of the libraries, that's why I am printing here my libraries.

Also I have an error that says "Multiple define' at the top of the console and as I know it's because of using both Dojo and jquery, (that error does not prevent the app from working) here is the order of my files:

<link rel="stylesheet" href="js/claro.css">
<link rel="stylesheet" href="js/esri.css">
<link rel="stylesheet" href="js/dgrid.css">
<link rel="stylesheet" href="css/dockpanel.css">
<link rel="stylesheet" href="css/maincss.css">
<link rel="stylesheet" href="js/jquery-ui.css">
<script src="js/init.js"></script> //arcgis API for JavavScript
<script
src="js/jquery-2.2.4.js"
integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="
crossorigin="anonymous"></script>
<script src="js/jquery-ui.js"></script>

and those are my librairies :How can I get rid of that error definitely ?

$( document ).ready(function() {

var map,updateFeature;

require([
"esri/config","esri/map",
"esri/toolbars/navigation",
"esri/graphic",
"esri/tasks/RelationshipQuery",
"esri/SnappingManager",
"esri/dijit/editing/Editor",
"esri/layers/FeatureLayer",
"esri/tasks/GeometryService",
"esri/toolbars/draw",
"dojo/keys",
"dojo/parser",
"dojo/_base/array",
"dojo/i18n!esri/nls/jsapi",
"esri/tasks/FindTask",
"esri/tasks/FindParameters",
"esri/symbols/SimpleLineSymbol",
"esri/symbols/SimpleFillSymbol",
"esri/symbols/SimpleMarkerSymbol",
"esri/Color",
"esri/renderers/UniqueValueRenderer",
"dgrid/Grid",
"dgrid/Selection",
"dojo/_base/declare",
"dojo/on",
"dojo/dom","dijit/registry",
"esri/dijit/Search",
"esri/dijit/AttributeInspector",
"esri/InfoTemplate",
"esri/dijit/Legend",
"esri/dijit/LayerList","esri/tasks/query",
"esri/tasks/QueryTask",
"dojo/dom-construct",
"dijit/form/Button","esri/geometry/Extent","esri/tasks/ProjectParameters","dojo/store/Memory","dijit/form/FilteringSelect", "dojo/ready", "dijit/Toolbar","dijit/layout/BorderContainer", "dijit/layout/ContentPane","dojo/domReady!"],
function(esriConfig, Map,Navigation, Graphic, RelationshipQuery, SnappingManager, Editor, FeatureLayer, GeometryService,
Draw, keys, parser, arrayUtils, i18n, FindTask, FindParameters, SimpleLineSymbol, SimpleFillSymbol,
SimpleMarkerSymbol, Color, UniqueValueRenderer, Grid, Selection, declare, on, dom, registry, Search, AttributeInspector, InfoTemplate,
Legend, LayerList, Query,QueryTask, domConstruct,
Button, Extent, ProjectParameters, Memory, FilteringSelect, ready) {
Tags (3)
1 Solution

Accepted Solutions
SaraEL_MALKI
Frequent Contributor

I've solved that error changing the order of the files in order to call the JavaScript files first then the Arcgis API file like that :

<link rel="stylesheet" href="js/claro.css">
<link rel="stylesheet" href="js/esri.css">
<link rel="stylesheet" href="js/dgrid.css">
<link rel="stylesheet" href="css/dockpanel.css">
<link rel="stylesheet" href="css/maincss.css">
<link href='//fonts.googleapis.com/css?family=Sofia' rel='stylesheet'>
<link href='css/eagle_lake.css' rel='stylesheet'>
 
<link rel="stylesheet" href="js/jquery-ui.css">
<script
src="js/jquery-2.2.4.js"
integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="
crossorigin="anonymous"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/init.js"></script>

View solution in original post

2 Replies
SaraEL_MALKI
Frequent Contributor

I've solved that error changing the order of the files in order to call the JavaScript files first then the Arcgis API file like that :

<link rel="stylesheet" href="js/claro.css">
<link rel="stylesheet" href="js/esri.css">
<link rel="stylesheet" href="js/dgrid.css">
<link rel="stylesheet" href="css/dockpanel.css">
<link rel="stylesheet" href="css/maincss.css">
<link href='//fonts.googleapis.com/css?family=Sofia' rel='stylesheet'>
<link href='css/eagle_lake.css' rel='stylesheet'>
 
<link rel="stylesheet" href="js/jquery-ui.css">
<script
src="js/jquery-2.2.4.js"
integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="
crossorigin="anonymous"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/init.js"></script>
EvelynHernandez
Frequent Contributor

Yes, always the api at last