The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Cant call an external script twice on a page - Example included
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=norma l&logo=1&zipcode=EUR|ES|SP018|LAS PALMAS DE GRAN CANARIA|&lang=uke&size=8&theme=summer2&metric=1&ta rget=_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! |
#2
|
|||
|
|||
I don't know for sure, but it could be that the script is just written to work only once per page. For example I notice that part of the code is "<div id='NetweatherContainer'", it could be that the js code looks for that div by id to insert the weather image.
You could use something like FireBug to see if the script is actually making more than one request to the weather server. ETA: I looked at the js script a little, and you could try taking out the id='NetweatherContainer' from the code (in all four places). It looks like that makes the script write the output instead of insert it in an existing element. |
#3
|
|||
|
|||
Thanks for the reply
I tried but unfortunately it's not working at all when thats taken out. Here is another script from another site that I tried: <div id="c_860c094892b99c0a1be9ce4b571be233" class="delgado"></div><script type="text/javascript" src="http://www.eltiempo.es/widget/widget_loader/860c094892b99c0a1be9ce4b571be233"></script> Same thing happening with that, I'm not sure why they aren't working. Thanks again! --------------- Added [DATE]1335199096[/DATE] at [TIME]1335199096[/TIME] --------------- I got it working doing what you suggested, I just made a mistake the first time! 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. Thanks again |
#4
|
||||
|
||||
You could always create seperate html pages for each & add them on you home page in iframes to get them all to show all at once.
|
#5
|
|||
|
|||
Quote:
For some reason the code looks like: Code:
<table><br /> <tr><br /> <td><br/> and you can't have <br/> tags between table tags like that, so when it's done the <br/> tags end up above the table and create the gap. I don't know where those tags are coming from. Could be you have something converting newlines to <br/> somewhere. |
#6
|
|||
|
|||
I don't know why it was showing <br />, like you said, something must be converting the code and adding that.
I changed it to a template instead of bbcode and it is showing up just how I wanted it. For some reason though it is making the recent threads section 100% with if a template is used. It could be a problem with CMPS, again I just have the table code in the template: HTML Code:
<table border="0" cellpadding="1" cellspacing="1"> <tbody> <tr> <td> <div style="width: 180px; height: 150px; background-image: url("http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg"); background-repeat: no-repeat; background-color: rgb(108, 178, 235);"> <script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|GRAN CANARIA|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script> <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);"> <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&locCode=EUR|ES|SP018|GRAN CANARIA|&metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div> </div> </td> <td> <div style="width: 180px; height: 150px; background-image: url("http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg"); background-repeat: no-repeat; background-color: rgb(108, 178, 235);"> <script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|TENERIFE|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script> <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);"> <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&locCode=EUR|ES|SP018|TENERIFE|&metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div> </div> </td> <td> <div style="width: 180px; height: 150px; background-image: url("http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg"); background-repeat: no-repeat; background-color: rgb(108, 178, 235);"> <script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|ARRECIFE|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script> <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);"> <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&locCode=EUR|ES|SP018|ARRECIFE|&metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div> </div> </td> <td> <div style="width: 180px; height: 150px; background-image: url("http://vortex.accuweather.com/adcbin/netweather_v2/backgrounds/summer1_180x150_bg.jpg"); background-repeat: no-repeat; background-color: rgb(108, 178, 235);"> <script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp?partner=netweather&tStyle=normal&logo=1&zipcode=EUR|ES|SP018|FUERTEVENTURA|&lang=uke&size=8&theme=summer1&metric=1&target=_self'></script> <div style="text-align: center; font-family: arial,helvetica,verdana,sans-serif; font-size: 10px; line-height: 12px; color: rgb(0, 0, 255);"> <a href="http://www.accuweather.com/world-index-forecast.asp?partner=netweather&locCode=EUR|ES|SP018|FUERTEVENTURA|&metric=1" style="color: rgb(0, 0, 255);">Weather Forecast</a> | <a href="http://www.accuweather.com/maps-satellite.asp" style="color: rgb(0, 0, 255);">Weather Maps</a></div> </div> </td> </tr> </tbody> </table> Thanks once again Kevin! --------------- Added [DATE]1335288333[/DATE] at [TIME]1335288333[/TIME] --------------- It was a problem with how CMPS uses the code through a template, fixed Thanks very much for all the help! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|