x

Re: geojson-Datei einlesen und einer Variable zuweisen


Geschrieben von dooley (Gast) am 02. Mai 2018 09:11:35: [flux]

Als Antwort auf: geojson-Datei einlesen und einer Variable zuweisen geschrieben von Wegabschneider (Gast) am 01. Mai 2018 16:34:

Harald Hartmann wrote:

Ok. Dann sei z.B. auf load json into variable

Ohoh, anscheinend habe ich da jahrelang etwas falsch gemacht. Das

I know async:false is deprecated, but what if you need to only load the json data one time? If it is loaded asynchronously then it would load each time the data is needed, which means more requests.

wusste ich nämlich nicht.

Im Ernst: Besser, man schaut sich die Doku http://api.jquery.com/jquery.ajax/ an (insbesondere den Abschnitt unter "async") und versteht grundsätzlich, wann wo welche Javascript-Variablen sichtbar sind https://www.w3schools.com/js/js_scope.asp.

Gruß, Frank

PS: Falls nicht bekannt, .getJSON ist nur ein Wrapper für .ajax