hey everyone!
I am trying to get some weather data from the openweathermap-webservice. Among the data is a the iconCode too in order to visualize the current weather condition.
Here is the xml-response of the given request:
one part of the response: ( i have shortened it a bit)
I want to retrieve all iconCodes of all forecast-days. (And it works fine with the temperature, wind direction, etc...
a part of the function which should get the data from the webservice:
If I add the line var iconCode = item.symbol.@var, I get the following syntax error:
I think I get the error because "var" is a reserved string in JavaScript. But how do I get the iconCode from the xmlPage then? Any suggestions?
Thank you so much in advance for helping me out!
Best regards,
Theresa
Do a LoadText instead and do a search/replace before creating the XML object ( new XML(string) )
hey Carles Coll,
I solved it this way as I wasn't able to convert the replaced string back to xml.
var iconCode = item.symbol['@var'];
Nevertheless, thank you for your suggestion!
Theresa