Author Topic: Confusion with VWS tags and AJAX markups  (Read 2965 times)

0 Members and 1 Guest are viewing this topic.

jwyman

  • Guest
Confusion with VWS tags and AJAX markups
« on: February 22, 2008, 10:22:40 AM »
I am a little confused in how to implement this stuff.....

I have a .php page which is pre-processed by VWS to change the vws tags to real data within the page. Not hard, right?  Then I decided to give the AJAX stuff a try. My understanding is that I can place the AJAX markup "<span....etc.....>" within my page and have the AJAX script yank the data from wflash.txt and update the span elements within the page according to the markups.. What is confusing me is that i see not only the AJAX realted tags but within those tags appear the old VWS tags which need to be processed by VWS then FTP'd up to the server. Here is where the confusion lays.... AM I missing something? Help plz.... :? :?

Jim

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3171
  • SCCA EM #156
    • North Georgia and US Weather
Re: Confusion with VWS tags and AJAX markups
« Reply #1 on: February 22, 2008, 10:31:36 AM »
Yes, the AJAX tags contain the VWS tags. Once the file is processed, unless you have other data on your page that neds to be refreshed, you don't really have to continue uploading or even processing that file. The updates will occur automatically (assuming you have WeatherFlash turned on and sending the data to the correct location on the server) without any other processing.

jwyman

  • Guest
Re: Confusion with VWS tags and AJAX markups
« Reply #2 on: February 22, 2008, 11:05:48 AM »
That's what is confusing me. I didn't think you needed to process that template file due to the span ids in the AJAX code. That means you have to have VWS pre-process the tags and FTP it up to the server... Confusion reigns!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6876
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Confusion with VWS tags and AJAX markups
« Reply #3 on: February 22, 2008, 11:09:47 AM »
I do recommend that folks using AJAX markup also continue to upload the page (with weather software tags) in order to allow folks who've turned off JavaScript to see your weather data anyway.

So, if you're using something like
Code: [Select]
<span class="ajax" id="ajaxtemp">^vxv007^^uni007^</span> to show the temperature, then you need to keep uploading the .htx so that VWS will replace the two weather tags with actual values.  Then the AJAX will kick in (if JavaScript is enabled), and replace the area between the <span></span> with new text.

If JavaScript is turned off in the browser and you don't upload through VWS, then the viewer sees the current temperature as '^vxv007^^uni007^' .. not too helpful.

So.. if your page has weather tags, then you should continue to upload it regularly through the weather software so your website 'works' irrespective of the browser's JavaScript on/off status.

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

jwyman

  • Guest
Re: Confusion with VWS tags and AJAX markups
« Reply #4 on: February 22, 2008, 11:26:26 AM »
Ken,
  Rather than doing the below

<span class="ajax" id="ajaxtemp">^vxv007^^uni007^</span>

can't I just do

<span class="ajax" id="ajaxtemp"></span>

 and have the AJAX.js place the valuse in the span for me and NOT have VWS have to pre-process tags?


Jim

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6876
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Confusion with VWS tags and AJAX markups
« Reply #5 on: February 22, 2008, 12:44:12 PM »
Jim,
Sure, you can use <span class="ajax" id="ajaxtemp"></span> if you like, and NOT upload through VWS.
The only downside is that viewers without JavaScript won't see any weather data (since AJAX won't be functioning).

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

Offline WeatherBeacon

  • Chief
  • Forecaster
  • *****
  • Posts: 1369
    • http://www.wxbeacon.com
Re: Confusion with VWS tags and AJAX markups
« Reply #6 on: February 22, 2008, 04:38:17 PM »

Hi, Jim.

I use Ken's ajax markup (with VWS/WF), but I still also upload that particular page from VWS to the server every 10 minutes for the reason he mentioned.

Regards,

Kevin...
Mae govannen!
Kevin  (Member AMS) http://www.wxbeacon.com               Genesee County, Michigan
Hardware:  Davis Vantage Pro Wireless, Midland WR-300
Software: VWS 14.01p43, WeatherFlash, & GRLevel3

jwyman

  • Guest
Re: Confusion with VWS tags and AJAX markups
« Reply #7 on: February 22, 2008, 05:12:58 PM »
Ah!!!! Finally understand.. Me slow  ](*,) ](*,) ](*,) Thanks for all the inputs.. Now to make a decision.....


Jim

 

anything