John_D
April 23, 2012, 3:09pm
1
Hey,
I am trying to show weather for 4 different cities for 4 islands on my homepage.
I have tried using 3 different websites so I think this must be a problem with vBulletin.
The first call works and shows the info but the others show the background but not the actual info for the weather from the script.
Here is an example:
<div style=‘width: 180px; height: 150px; background-image: url( http://vortex.accuweather.com/adcbin...180x150_bg.jpg ); background-repeat: no-repeat; background-color: #D0ADAA ;’ ><div id=‘NetweatherContainer’ style=‘height: 138px;’ ><script src=‘http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018| LAS PALMAS DE GRAN CANARIA|&lang=uke&size=8&theme=summer2&metric=1&target=_self’></script></div>
If I try to add this more than once it only works the first time.
Does anyone know why its happening or what I can do to display more than 1?
Thanks!
Strip the inner Div tag (the one with id=‘NetweatherContainer’) out. The javascript file you’re including contains this:
if (document.getElementById(‘NetweatherContainer’) != null) {
document.getElementById(‘NetweatherContainer’).innerHTML = str;
}else {
document.write(str);
}
So if you remove all the NetweatherContainer divs, it will just write each result out to your page, rather than replacing the contents of the div.
John_D
April 24, 2012, 1:11am
3
Thanks very much, that got it working
It is showing up now but just a bit out of place - Not sure if the div is effecting it at all ( Http://www.NorthWestSocial.com/canary )
There is a large space above the table - I am using a bbcode module and just have the table in the module, would you know anything about this at all?
Thanks again!
You could try reading the div, but without the Id attribute. Other than that, I’d ask someone in the CSS forum. I’m kinda hopeless with getting things lined up.