jdkuhn
August 14, 2009, 5:00pm
1
I’m getting page warning/error icon at the bottom left cornor with IE7 but not with FF. Pages validate successfully as XHTML 1.0 Transitional! If you double click on warning/error in IE7 it has:
Line 598
Char: 1
Error: Syntax Error
ode: 0
URL: http://www.harpersferry-weather.com
How can I get rid of this?
Thanks,
John
http://www.harpersferry-weather.com
ktrue
August 14, 2009, 5:07pm
2
I think it’s because you’ve included a small PHP snippet inside your JavaScript and JavaScript doesn’t know what to make of that.
You have
if(clientraw[0] == '12345' && wdpattern.test(x.responseText) &&
( updates <= maxupdates || maxupdates > 0 ) ) {
if (maxupdates > 0 ) {updates++; } // increment counter if needed
<?php
// Cloud Height
stationAlt = 0; // your station altitude in meters if you want ASL (meters = ft / 3.2808399)
temp = clientraw[ 4];
dewp = clientraw[72];
cloudheight = Math.max(0,(temp-dewp)/0.00802)*1.0 + stationAlt; // in meters
altitude = (useunits=="E") ? Math.round(cloudheight*3.2808399) : Math.round(cloudheight);
above = (stationAlt>0)? ' ASL' : ' AGL';
cloudText = altitude.toString() + uomHeight + above;
param = '?uom=' + useunits + '&alt=' + altitude + '&alti=' + uomHeight + '&wind=' + uomWind;
set_ajax_obs("ajaxcloudheightimg"
,'<img src="cloud-base.php' + param
+ '" alt="' + cloudText
+ '" title="' + cloudText
+ '" width="100" height="200" hspace="0" vspace="0" align="" border="0" style="" />');
?>
//Temperature
temp = convertTemp(clientraw[4]);
in ajaxWDwx.js
It should read (without the ‘<?php' and '?>’ lines) as
if(clientraw[0] == '12345' && wdpattern.test(x.responseText) &&
( updates <= maxupdates || maxupdates > 0 ) ) {
if (maxupdates > 0 ) {updates++; } // increment counter if needed
// Cloud Height
stationAlt = 0; // your station altitude in meters if you want ASL (meters = ft / 3.2808399)
temp = clientraw[ 4];
dewp = clientraw[72];
cloudheight = Math.max(0,(temp-dewp)/0.00802)*1.0 + stationAlt; // in meters
altitude = (useunits=="E") ? Math.round(cloudheight*3.2808399) : Math.round(cloudheight);
above = (stationAlt>0)? ' ASL' : ' AGL';
cloudText = altitude.toString() + uomHeight + above;
param = '?uom=' + useunits + '&alt=' + altitude + '&alti=' + uomHeight + '&wind=' + uomWind;
set_ajax_obs("ajaxcloudheightimg"
,'<img src="cloud-base.php' + param
+ '" alt="' + cloudText
+ '" title="' + cloudText
+ '" width="100" height="200" hspace="0" vspace="0" align="" border="0" style="" />');
//Temperature
temp = convertTemp(clientraw[4]);
Best regards,
Ken
jdkuhn
August 14, 2009, 5:15pm
3
That did it Ken . Thank you very much.
Regards,
John