Page 2 of 2

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Thu 06 May 2010 9:46 am
by gemini06720
Synewave wrote:...I think I may stick with my own translated version of Le hamel.
Indeed, Paul, the french texts on the 'Le Hamel Météo' page will always be better than anything you will 'instantly' get from Google... ;)

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Fri 07 May 2010 7:29 pm
by daj
gemini06720 wrote: ... but I wanted to get David's permission before 'stealing' his code...
Please feel free to take what you want. If I can help by explaining anything please ask

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sat 08 May 2010 11:01 am
by gemini06720
daj wrote:Please feel free to take what you want. If I can help by explaining anything please ask
David I preferred to ask before using ... that is just me... ;)

I have not had time, yet, to look at the JavaScript on your Web pages... :oops:

I have been very busy upgrading my weather pages (the ones managed by the other software... :roll: ) - I have installed some incredible FusionCharts flash-type weather graphs. Two new graphs have been added to a new page called [link removed].

Here is a link to some of the FusionCharts graphs available for the 'other' software: [link removed] - the graphs on that page are only 2D.

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sat 08 May 2010 8:31 pm
by daj
gemini06720 wrote:Here is a link to some of the FusionCharts graphs available for the 'other' software: Flash Graphs - the graphs on that page are only 2D.
Interesting -- I'm not a huge fan of flash (maybe because I am a Mac) and it kills your battery as it is such a poorly written implementation for the Macs but it has its place. I might explore it futher as I am in the market for a tool to do good charting. Liking the Global Cooling/Warming page.

When having a look at your 'other software' site I was getting lots of errors, "Undefined indexes", but I guess that is because it is a work in progress

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sun 09 May 2010 1:41 am
by n9mfk
Hi Ray an David,
Ray what did you find to help debug script?
David can I have a copy of this page http://www.grantownweather.co.uk/realtime ?
thanks Beau

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sun 09 May 2010 8:51 am
by gemini06720
n9mfk wrote:Ray what did you find to help debug script?
Beau, I am sorry but I do not understand what you are asking!

I am debugging many scripts of my own or from someone else design and adapting them to my Web pages, so I am not debugging one script in particular. So, when you ask what problem I found and corrected to one script, you need to be a bit more precise as to which script you are referring to...

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sun 09 May 2010 12:24 pm
by daj
n9mfk wrote:....
David can I have a copy of this page http://www.grantownweather.co.uk/realtime ?
Beau

This page is actually based on my weather console page

https://cumulus.hosiene.co.uk/viewtopic.php?f=14&t=2149

it works in exactly the same way

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sun 09 May 2010 3:37 pm
by n9mfk
Ray this was in your message
I found a way to check the progress of my modification and to determine (approximately) where an error had occurred

I has ask how you had done this ?

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sun 09 May 2010 9:28 pm
by gemini06720
n9mfk wrote:Ray this was in your message
I found a way to check the progress of my modification and to determine (approximately) where an error had occurred
I has ask how you had done this ?
OK, now the muddy waters are getting clearer ... matter of writing... :)

You meant for the JavaScripts...

With some small scripts, such as the one I use for Cumulus, I placed a line such as 'document.write('MADE IT UP TO HERE!')' at or near the top of the script and moved the line downward as I added new functions (below the new function or the newly added code).

For example, using David's CumulusWeatherConsole script ('wconsole.js'), I would place the 'document.write('MADE IT UP TO HERE!')' at line 60:

Code: Select all

...
 $("#today-temphigh").html(rawdata[26] +" at "+ rawdata[27]);
 $("#today-templow").html(rawdata[28] +" at "+ rawdata[29]);
 $("#today-windgust").html(rawdata[32] +" at "+ rawdata[33]);
 $("#today-windavg").html(rawdata[30] +" at "+ rawdata[31]);

 $("#last_contact").html(rawdata[0] +" "+ rawdata[1]);

document.write('MADE IT UP TO HERE!')

 // Calculate the Beaufort desc
var beau = rawdata[12];
if (beau=="0"){var bdesc="Calm";} else
if (beau=="1"){var bdesc="Light Air";} else
if (beau=="2"){var bdesc="Light Breeze";} else
...
So, when I run the code through my server, and I see on the screen the words 'MADE IT UP TO HERE!', I know that the top part of the code is OK.

Then, I would add some more lines of code and I would move the 'document.write('MADE IT UP TO HERE!')' line below that new code.

This line is not reporting any error message nor the exact location of the error, but has help me in pinpointing the area where the code error might be. But, if there is a jump to an other function, then the line has to be move also within that function.

It is time consuming but with patience, one eventually gets to the end of the script. The longest script I worked on had in excess of 2800 lines of code (that was the latest version of 'ajaxWDwx') - thankfully, the script designer, Rainer Finkeldeh, had included a special control line of code before every major functions/operations. So, when the script is run on my local or Internet server (it sees my IP address) it displays (very quickly, almost impossibly to see/view ... unless there is an error in the previous code group) the text contained within all the control lines and eventually displays the control line '[Status: OK] [progress: -- DONE --]' message, meaning that the code has run as expected (from top to bottom) without any error.

Re: AJAX - is it the new Betamax? What are your experiences?

Posted: Sun 09 May 2010 9:39 pm
by mcrossley
You probably already know all this but for anyone who doesn't...

The script debugger built into IE8 works pretty well. You can set breakpoints, view the call stack, variables, step through your code, alter variable contents on the fly, alter your HTML on the fly etc.

You can jump to the debugger on error by setting an advanced option, or put a 'debugger;' statement in your code where you want it to break, and hit F12 to bring up the developer tools, switch to script, and enable debugging before refreshing your page.