Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 11-21-2007, 02:56 AM
neverstop neverstop is offline
 
Join Date: Jan 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 11-21-2007, 11:28 AM
UK Jimbo's Avatar
UK Jimbo UK Jimbo is offline
 
Join Date: Sep 2002
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 11-22-2007, 04:57 AM
neverstop neverstop is offline
 
Join Date: Jan 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 11-22-2007, 03:23 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #5  
Old 11-22-2007, 06:50 PM
neverstop neverstop is offline
 
Join Date: Jan 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #6  
Old 11-22-2007, 07:57 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm, I just did a test and it worked for me.
Reply With Quote
  #7  
Old 11-22-2007, 09:21 PM
neverstop neverstop is offline
 
Join Date: Jan 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #8  
Old 11-22-2007, 09:34 PM
Analogpoint's Avatar
Analogpoint Analogpoint is offline
 
Join Date: Feb 2007
Posts: 656
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 11-22-2007, 09:42 PM
neverstop neverstop is offline
 
Join Date: Jan 2007
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Thanks alot!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:34 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.03850 seconds
  • Memory Usage 2,229KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (2)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete