What's the way for jquery reference in javascript?
f someone could give me a quick guide on how to hook up jQuery, via CDN?
Following along with the documentation here, this is what I have so far. I'm just unsure it'll work. I'm also not sure if I should encapsulate my entire javascript code in the jQuery() function or if I should only encapsulate those things that actually use jQuery. The example makes it seem like you should put everything in there, so that way you know that the page isn't doing anything before jQuery is ready. Is that sound logic?
I have tried the below code, and while I don't get any errors in the browser console, the basemap loads really weird. It loads all the labels, but none of the imagery until I zoom in a level, then it rights itself and the imagery shows up: enter image description here
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>FeatureLayer</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.23/dijit/themes/claro/claro.css"><link rel="stylesheet" href="https://js.arcgis.com/3.23/esri/css/esri.css">[removed][removed][removed][removed][removed][removed]
<style>
//more styles
</style>
script>
require([
"esri/map",
"dojo/parser",
"dojo/domReady!"
],
function(
Map,
parser
) {
parser.parse();
var map = new Map("map", {
basemap: "hybrid",
centre: [-90.603281, 36.241294],
zoom: 5
});
on(map, "load", function(){
$(document).ready(jQuery);
});
function jQuery(){
//rest of my application goes here
});
});
I think regarding the jquery reference, the main issue is that with the particular versions of dojo, jQuery, and jQuery-UI you're using, there's a loading issue where you need to load jQuery-UI first.