AnsweredAssumed Answered

Creating a Button to Activate Popup - Issue

Question asked by ipeebles on Apr 28, 2016
Latest reply on Apr 28, 2016 by thebillcarr

I have a popup that works well within the application.  However, my goal is to tied the popup to a button, where the user must click on the button to activate the popup.  I keep getting an error in console mode that states" unexpected identifier and the button does not fire the popup.  I have two files, an index.htm and the infoTemplate.js file.  Here are snippets of my code:

 

index.htm

 

<script src="js/infoTemplate.js"></script>

 

<!-- Required Application Modules -->
require([
  "dojo/on",
  "dijit/registry",
  "dojo/dom"
], function(
   on,

   registry,
   dom
)

 

  // Code Application Function
  on(dom.byId("btnActivatePopup"), "click", activatePopup);

 

DIV section

<button id="btnActivatePopup">PopUp</button>

 

 

infoTemplate.js

 

require([
  "esri/dijit/Popup",
  "esri/dijit/PopupTemplate"
], function(
  Popup,
  PopupTemplate
)

 

function activatePopup() {

<all of the popup template code in here>

}

 

What is it that I am missing?  Any assistance will be appreciated.  Thanks.

Outcomes