Author Topic: AJAX Basic Question  (Read 2370 times)

0 Members and 1 Guest are viewing this topic.

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
AJAX Basic Question
« on: September 10, 2007, 07:04:26 AM »
While experimenting with VWS and AJAX, I listed all the possible AJAX/VWS tags with the descriptions on one page to see how it works. I've fiddled around with it for a couple of days to see how it works and I'm un-clear on some of this.
Since the data gets updated from the data.csv file, how can some of the tags get updated by AJAX if the data isn't in the data.csv file?   For instance the Wind Run Year    <span class="ajax" id="ajaxyearlywindrun">^vxv135^ ^uni135^</span>
Since this data isn't in the csv file, what is the purpose of the ajax tag?

Here is the AJAX page  http://www.weather.ricksturf.com/ajax1.htm

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AJAX Basic Question
« Reply #1 on: September 10, 2007, 11:44:31 AM »
Hi Curly,

There are two versions of VWS AJAX available.  The older version uses data.csv for it's source, and the associated JavaScript only provided updates for the variables that appeared in data.csv.

The newer VWS AJAX JavaScript uses the Weather Flash files (wflash.txt, wflash2.txt ) as the source of data.  Since those files have a LOT more info in them, the associated ajaxVWSwxf.js script handles a lot more tags.

Generally, you can't use the original JavaScript with the Weather Flash files, nor can you use the new ajaxVWSwxf.js script with the data.csv files.

Your test page seems to be using the old data.csv script for updates to a page with markup for the new ajaxVWSwxf.js script -- you'll need to select one or the other and not mix the versions in order to get the results you desire.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: AJAX Basic Question
« Reply #2 on: September 10, 2007, 12:56:20 PM »
You've explained it very well!

I'll mess with it this evening.

Thanks!

Offline Curly

  • Forecaster
  • *****
  • Posts: 724
    • Michiana Weather
Re: AJAX Basic Question
« Reply #3 on: September 10, 2007, 09:19:01 PM »
I traded the csv's for the txt's and use ajaxVWSwxf.js
It works great !

http://www.weather.ricksturf.com/ajax.htm

Thanks Ken

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: AJAX Basic Question
« Reply #4 on: September 10, 2007, 09:36:35 PM »
You're very welcome!  Glad it's working for you now.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP