Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

What's the way for jquery reference in javascript?

Asked by Kirsty Deller Oct 10, 2022 938 views 1 answer
Share

About this question

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
    });
  });


Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.