I hope this isn't old news and that I haven't wasted time researching and finding a solution...
I've seen many people complain about installing the module and not having it work - they only get the loading icon despite having the pre-requisites... I've been playing with this module at different sites and it drove me crazy because on some sites it worked, otherwise it didn't --- all sites were hosted by GoDaddy.com.
I debugged the code and figured out what was happening for me. There may be a better solution than what I did, but I wanted to bring this up here so (1) the problem can be identified; (2) if a better solution exists I can replace my fix with something better; (3) the next version of googleWeather can get this addressed :-)
So the problem came down to the request.open throwing a TypeError exception, Access is denied. This is in the mod_GoogleWeather_ajax.js/gw_SendData function. Looking at the url, it was fine --- I even copied the url into my browser and it worked... But there was a problem there. After digging around it turns out that the sites that I've had the module working on were subdomains, all primary domains I had it installed on failed.
The end result... This was happening because the "www." is stripped off of the url --- if I recall correctly this is part of the apache mod_rewrite functionality. So if I went to
http://domain.com it would work. If I went to
http://my.domain.com it would work. If I went to
http://www.domain.com it would NOT work as the JURI::base which is used for "url" does not have the "www." on it...
Since I believe this is an apache setting on GoDaddy I'm guessing I can't change the way it works, so I replaced the request.open with the following code:
| Code: |
try {
request.open( "GET", url, true );
} catch (e) {
url = url.replace("http://", "http://www.");
request.open( "GET", url, true );
}
|
This could be made more robust (checking for www already and adding another try/catch for the second open, but it fixed my problem and serves my needs...
Hope this helps!
J.