laptop and a wrench

Bogue

When there are no query parameters present in the input URL, an exception is encountered while obtaining value after esri.urlToObject(url).query method.

Dernière publication: August 25, 2014 ArcGIS API for JavaScript
Numéro d’ID de bogue NIM052292
EnvoiDecember 22, 2009
Dernière modificationJune 5, 2024
S’applique àArcGIS API for JavaScript
Version trouvée1.5
Langue du programmeJavaScript
Système d’exploitationWindows OS
Version du système d’exploitation2003
Version de correctionArcGISJavaScriptAPI 1.6
StatutFixed

Solution de contournement

You can avoid the errors by adding some type checking to the code. I've modified the snippet below to check if query is null and foo is undefined before trying to work with them. var myObject = esri.urlToObject(window.location.href); if(myObject.query){ var query = myObject.query alert('query is ' + query); if(query.foo){ var foo = query.foo; alert('value of foo parameter is ' + foo); } }

Étapes pour reproduire

ID de bogue: NIM052292

Logiciel:

  • ArcGIS API for JavaScript

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement