Pulling in ad banners via javascript - based on node, etc,


Well-known member
I run a banner rotation program which allows me to define urls to access the program - such as:
Which then brings in various rotations of specific banners and google ads.....

The URL above, if you select it and refresh, will bring in ads which go in our Wood Pellet Forum at the bottom....for instance.

I'm setting this up now in XF and using some JS from my old setup - and it seems to be acting a little strange :
(works OK....but sometimes does not come up...maybe cache issues)
(Edit - I think this is fixed )

I think I have at least two issues.....here is how I build the call to banner program:
<xen:hook name="ad_below_bottom_breadcrumb" />
<xen:if is="{$forum.node_id} > 0">
<div style="text-align: center;">
<script type="text/javascript">
function staticLoadScript(url)
  document.write('<script src="', url, '" type="text/JavaScript"><\/script>');
staticLoadScript("http://hearth.com/cgi-bin/forumbottom" + {$forum.node_id} + '.' + "pl?jscript");
Can anyone give me a more modern method of pulling in the result of a URL call? Or is this part OK?

The second issue may be caching. That may relate to the call or otherwise - but is there anything which can be done to assure that this loads up better?

There may be some issues related to the ancient ad banner program I use - but I can either fix these or replace it with another program (later)...it's worked for me for many years, though.

Any advice welcome.....oh, the banner program gives me the option of loading the banners up in various ways - the above uses a jscript method, but the program allows for 3 ways to call:
as listed here:

Edit - addition....
I think I fixed some perl and naming problems - things are better, but still want advice if the code is a decent way of pulling in a banner....thanks!