Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Script works only with WI-FI Connection
-
@Leonardo-Augusto Your Welcome! Just curious, was it type: GET that did it as I suspect that was the cause?
-
@munsterlander yes man! . GET!!! The code was loading and loading. But now is faster! Just a doubt if you understands open Weather API:
how i can filter the alert for example : show only the description and the city name.
-
Basically, the JSON response can be thought of as nested arrays/objects. You get the data by using:
success: function(data) { alert(data.weather[0].description+'\n'+data.name); }
EDIT: To get more data, reference this document:
http://openweathermap.org/current#current_JSON
Basically, to get any of the inset items, then you would use:
parent[0].inset_item
So:
success: function(data) { data.main[0].temp data.sys[0].country etc // But the ones that don't have an inset, can be referenced directly. data.name }
-
@munsterlander hummm thanks for your big help! Dale dale Dartitis!
-
@munsterlander said:
success: function(data) {
alert(data.weather[0].description+’\n’+data.name);
}hooohohohoh that was it!!!
http://openweathermap.org/current#current_JSON
:stuck_out_tongue_closed_eyes: :stuck_out_tongue_closed_eyes: :stuck_out_tongue_closed_eyes: :stuck_out_tongue_closed_eyes:
-
@Leonardo-Augusto Glad it all worked out!
-
@munsterlander yes , now i’ll make an adaptation for the project. Using Onsen Ui Alert . Amazing!! when you’ll open your class to teach! :grimacing:
-
@Leonardo-Augusto Jeje, I definitely couldn’t teach other than hacking things together! :smiley: I do want to give a :thumbsup: to the Onsen team with https://onsen.io/2/reference/ons.notification.html, you can do such amazing things with it, just like you did for Dartitis. Awesome stuff and can’t wait to see your new app!
-
@munsterlander Yes . Onsen notification is very useful. I have used on my new app.
Could be possible to use a Custom icon in Ons notification.
-
I would see no reason why you couldn’t. I know there was a bug with dynamic icons, but here is a response for custom ones.
-
@munsterlander ohhh new to me, (Inside ons notification)i’ll check out!