vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Slow loading script problem. (https://vborg.vbsupport.ru/showthread.php?t=163243)

neverstop 11-21-2007 02:56 AM

Slow loading script problem.
 
Hi,

I have a script from an advertiser that produces a geo-targetted text link. The problem is the script is slow to load which delays loading the rest of my site, as this code is placed in the header. Is there some way I can have the script load last, but still have it show in the header?

Here is the relevant code from the advertiser.

Code:

<script src="http://banners.adultfriendfinder.com/piclist?message=5&amp;p=text_links&amp;pid=p174798&amp;rand=4&amp;target=_blank&amp;site=ffadult&amp;this_page=banners_text_links"></script>
Cheers,
Ian

UK Jimbo 11-21-2007 11:28 AM

Try:

Code:

<script src="http://banners.adultfriendfinder.com/piclist?message=5&amp;p=text_links&amp;pid=p174798&amp;rand=4&amp;target=_blank&amp;site=ffadult&amp;this_page=banners_text_links" defer></script>
the defer tag should make the browser handle it after the page has been rendered

neverstop 11-22-2007 04:57 AM

Hi,

Apparently the defer attribute does not work in firefox.

I am hoping to find a solution using css position maybe? or javascript even?

Cheers

Analogpoint 11-22-2007 03:23 PM

Put this where you want the ads:
HTML Code:

<div id="adsplaceholder"> </div>
Put this at the very bottom of the footer.
HTML Code:

<div id="myads"><script src="http://banners.adultfriendfinder.com/piclist?message=5&amp;p=text_links&amp;pid=p174798&amp;rand=4&amp;target=_blank&amp;site=ffadult&amp;this_page=banners_text_links"></script></div>
<script type="text/javascript">
var adtarget = document.getElementById('adsplaceholder');
var ads = document.getElementById('myads');
adtarget.appendChild(myads);
</script>


neverstop 11-22-2007 06:50 PM

Hi,

After making those edits, nothing shows up where the adsplaceholder div is, and the myads div shows at the very bottom of the footer...

Analogpoint 11-22-2007 07:57 PM

Hmmm, I just did a test and it worked for me.

neverstop 11-22-2007 09:21 PM

Any ideas what I could be doing wrong? These edits seem pretty simple...

So just to be clear I added the adsplaceholder div in my header, with nothing between the div tags. And added the myads div + the javascript in my footer. The ad shows where the myads div is placed, and nothing shows up where the adsplaceholder div is...

Analogpoint 11-22-2007 09:34 PM

Ok, I just tested it again.

I added this to the very bottom of the navbar template
Code:

<div id="adsplaceholder"></div>
And the following to the very bottom of the footer template
Code:

<div id="myads"><script src="http://banners.adultfriendfinder.com/piclist?message=5&amp;p=text_links&amp;pid=p174798&amp;rand=4&amp;target=_blank&amp;site=ffadult&amp;this_page=banners_text_links"></script></div>
<script type="text/javascript">
var my_ads = document.getElementById('myads');
document.getElementById('adsplaceholder').appendChild(my_ads);
</script>

Try that.

neverstop 11-22-2007 09:42 PM

Yup that worked! Sure beats using a ghetto transparent iframe.!

Thanks alot!


All times are GMT. The time now is 12:01 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01058 seconds
  • Memory Usage 1,729KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete