HI,
I have layers list from different map servers.How to do identifier task for those layers
Veena,
The IdentifyTask does not care if you have multiple different map services in your map. Here is a sample for the JS API samples:
Display identify results in popup | ArcGIS API for JavaScript 3.23
in identifier task they passed URL,that URL i have different url around five url's i have.How to do identifiers for those url.
Veena,
You will have to use a separate IdentifyTask for each url. The way to handle this is to loop through all the layers in the map and create a array of mapservice urls and create a IdentifyTask for each add each of those IdentifyTasks to a dojo/promise/all that way you do not work with the results until all your IdentifyTasks are complete. There is several threads about this and if you want actual code you can look at then you can look at my Identify Widget for the Web App Builder:
https://community.esri.com/docs/DOC-3250-identify-widget-version-23-02172017
Try to use a webmap in order to construct the map contains. Web map by ID | ArcGIS API for JavaScript 3.23
Through the webmap is very easy to setup the identify popup for each layer using the arcgis online viewer.
Finally you can use this webmap (JSON) into your code Web map using JSON | ArcGIS API for JavaScript 3.23 .
Also using the webmap you have all the other benefits like set the symbology, enable labels for Feature services e.t.c.