TypeError: query is not a function

5733
4
Jump to solution
01-18-2017 12:33 PM
Alexwang
Occasional Contributor II

Hello, I wanted to get html elements for a class using dojo/query within then() of queryTask. Please see below. Using query(class) return a "TypeError: query is not a function." But it worked when i used document.getElementsByClassName(classname). What did I missed on the query way? Thanks!!!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Was is the name of the parameter you assigned the require to? Is is query? It looks like you have "esri/tasks/query" as well, so did you give dojo/query a unique var?

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Alex,

   Do you have the require for "dojo/query" in you require list?

0 Kudos
Alexwang
Occasional Contributor II

Thanks Robert for your quick response. Yes i double checked and do have "dojo/query"  module in the list. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Was is the name of the parameter you assigned the require to? Is is query? It looks like you have "esri/tasks/query" as well, so did you give dojo/query a unique var?

Alexwang
Occasional Contributor II

lol... thank you, Robert. I have a local variable called query which caused the problem. 

0 Kudos