I am editing javascript code of ArcGIS API for JavaScript for online map.
the piece of code is here:
var lvEsriPopupT = new esri.dijit.PopupTemplate(
{
"title": "Weather",
"outFields": "*",
"fieldInfos": [{
"fieldName": "Temperature",
"label": "Temperature deg& C",
"visible": true},
... ],
...
});
The code works fine. the issue that I am trying to fix, is displaying the degree symbol inside double quotes. anything I tried (° ℃ ℃) comes ups without being decoded to the actual symbol. I suspect it is because it is inside double quotes.
Is there a solution for that?
1 Answer 1
Why Didn't you use directly the ° character ?
otherwise use js String.fromCharCode
function to render char from It's ascii code (degree = 176 ) like bellow :
var lvEsriPopupT = new esri.dijit.PopupTemplate(
{
"title": "Weather",
"outFields": "*",
"fieldInfos": [{
"fieldName": "Temperature",
"label": "Temperature "+String.fromCharCode(176)+"C",
"visible": true},
... ],
...
});
-
does it solve your issue ?Bourbia Brahim– Bourbia Brahim2017年01月16日 07:11:11 +00:00Commented Jan 16, 2017 at 7:11
-
Thank you! Your solution worked perfectly. I tried to use ° character but in my code editor (notepad ++) it would change to normal o.lida– lida2017年01月16日 07:58:38 +00:00Commented Jan 16, 2017 at 7:58
-
Great :) , So please up and mark the answer as resolved ✓ (left the answer ) ( like in this image =>image resolve post ) thank you .Bourbia Brahim– Bourbia Brahim2017年01月16日 09:04:49 +00:00Commented Jan 16, 2017 at 9:04
Explore related questions
See similar questions with these tags.