I’m quite new to javascript, but have managed to write a working xml function 🙂
I was hoping someone could please give me a rundown of how to optimise the function. At present there’s a different function for each state’s weather, but I was hoping I could simplify this somehow.
Code is pasted here: http://pastie.org/private/ffuvwgbeenhyo07vqkkcsw
Any help is greatly appreciated.
Thank you!
EDIT: ADDING CODE EXAMPLES OF BOTH XML FEEDS:
Function 1 (UV): http://pastie.org/private/jc9oxkexypn0cw5yaskiq
Function 2 (weather): http://pastie.org/private/pnckz4k4yabgvtdbsjvvrq
I would suggest you create an array that holds the UV element IDs, suffixes and weather station ids (stationid)
and then for the UV
and for the weather