+ 3
[Solved] Help me in working with json
I am working with api using jquery $.getJSON() but it not working well...help me to understand. https://code.sololearn.com/W2AArtvMfPpf/?ref=app I have url in code you can search it for json , which i am requesting for...it is giving json there in browser but not in code on sololearn...
8 Réponses
+ 2
In code "ipadress", at line 24 change data.i to data[i]
+ 3
Would you explain data[i] 🤔🤔
+ 2
Error message from developers console
"Mixed Content: The page at 'https://code.sololearn.com/W2AArtvMfPpf/?ref=app' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.7timer.info/bin/civil.php?lon=113.2&lat=23.1&ac=0&unit=metric&output=json&tzshift=0'. This request has been blocked; the content must be served over HTTPS."
+ 2
It means it was due to reason that sololearn has https... and that json has http... ha!!!
Thanks for explanation sir.
By the here i have next try a bit closer to result but not properly think due to same error...
+ 1
https://code.sololearn.com/W80JUe50yv9A/?ref=app
in this code i have request over https....
json but it showing undefined...would you help me here...
+ 1
Use bracket notation, because it is the correct way to access the object that is being iterated .
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in
+ 1
Thanks ODLNT
+ 1
No problem, I'm glad I could help.