Rene,

Thanks so much for posting.

I got the site up, using the iBegin weather widget on it's own.  If it
helps, here's a link:  http://tinyurl.com/5n8mco

I'll take a stab at doing what you suggest... wish me luck! :D  But...
expect to hear more questions from me soon.

 - John

On Sep 6, 3:50 am, "Rene Veerman" <[EMAIL PROTECTED]> wrote:
> if the weather widget creates a javascript object in the js namespace, you
> can test for that when the page has loaded. you can even try to
> re-initialize the weather widget if it fails the first time (but that would
> take some doing).
>
> you'd need to include the weather widget in the <head> of your target page.
> and assume that the weather widget makes the global js var "weatherWidget"
> available.
>
> you could try this;
> <head>
>   <script language='JavaScript1.3' type='text/javascript' 
> src='http://somehost.com/widgets/weather_widget.js'></script>
>   <script language='JavaScript1.3' type='text/javascript'>
>      <!--
>     window.onload = function () {
>         //call previous window.onload statements here
>
>         var scriptSrc = 'http://somehost.com/widgets/weather_widget.js';
>         if (!weatherWidget) {
>             var scriptsInHead =
> $('script',document.getElementsByTagName("head")[0]);
>             var found = false;
>             for (var j=0; j<scriptsInHead.length && (!found); j++) {
>                 if (scriptsInHead[j].src == scriptSrc) found = j;
>             }
>             var e = document.createElement("script");
>             e.type="text/javascript";
>             e.language='JavaScript';
>             e.src = scriptSrc;
>             if (found===false) {
>                 if (console) console.log ("appending "+e.src+" to HEAD.");
>                 __htmlHead.appendChild(e);
>             } else {
>                 if (console) console.log ("removing then re-adding "+e.src+"
> to HEAD.");
>                 scriptsInHead[found].parentNode.removeChild
> (scriptsInHead[found]);
>                 __htmlHead.appendChild (e);
>             }
>         } else {
>             //optional:
>             weatherWidget.initialize();
>         }
>         setTimeout (window.onload, 300); //retry in 300 milliseconds
>     }
>     -->
>     </script>
> </head>

Reply via email to