Ero sivun ”Widget:Test” versioiden välillä
Järvi-meriwikistä
Rivi 1: | Rivi 1: | ||
− | < | + | <includeonly> |
+ | <script type="text/javascript" src="//www.jarviwiki.fi/citobsjs/citobso311.js" ></script> | ||
+ | <script type="text/javascript" src="//www.jarviwiki.fi/citobsjs/jwapi.js" ></script> | ||
+ | <script type="text/javascript"> | ||
+ | |||
+ | var co = new CitobsOpen311(); | ||
+ | var jw = new jwApi(); | ||
+ | |||
+ | var ready = function() { | ||
+ | |||
+ | if ( --loadr == 0 ) { | ||
+ | |||
+ | console.log( co ); | ||
+ | console.log( jw ); | ||
+ | |||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | var loadr = 0; | ||
+ | var days = 6; | ||
+ | var startDate = new Date(); | ||
+ | startDate.setDate( startDate.getDate()-days ); | ||
+ | |||
+ | loadr++; jw.loadObses( { 'obscode': 'alg', 'startdate': startDate.toISOString() }, ready ); | ||
+ | |||
+ | for ( var ot in jw.jwToCitobs ) { | ||
+ | loadr++; co.loadRequests( { 'keyword': '_VesiFiObservation', 'service_code': jw.jwToCitobs[ ot ].service_code, 'start_date': startDate.toISOString(), 'status': 'valid' }, ready } ); | ||
+ | } | ||
+ | |||
+ | </script> | ||
+ | </includeonly> |