HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

Because we have a string as the image source we cannot put a string


within a string.Let’s declare a local variablevarimgSrcand give it the vale of


the url till the icon data:


Then the data name from the console + icon +


And the format".png"


"http://openweathermap.org/img/w/" + icon + ".png"

So now this local variable will be our img source.

Free download pdf