Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Code snippet required

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
Webbo Posted - 21 June 2015 : 13:22:07
Is it possible to add a snippet of code to an <!--#INCLUDE FILE="myfile.asp"--> so that it loads after the rest of the page has loaded, and if so what would it be?


The issue is I use adserving software to place banner adverts within my forum pages and the code for the banner zones is added where required using includes and separate files.
Occasionally if a banner is slow to load it holds up the rest of the page until it has done so. If I could add a snippet of code to tell the forum software not to load the include file until the rest of the page has loaded then this would resolve the problem - I think

Thanks
6   L A T E S T    R E P L I E S    (Newest First)
ruirib Posted - 24 June 2015 : 08:30:04
quote:
Originally posted by Webbo

It basically sets the zone for the banner advert and calls the relevant banners for that zone.

Looking into JQuery there seems to be an issue using it and document.write if I've interpreted what I've read correctly :)

It's a shame that we cant use a <!--#INCLUDE FILE_After_everything_else="myfile.asp"--> command


If it sets the zone for adverts, it doesn't need to be called in that area of the page. It can be called, anywhere, I would think?

document.write can be easily replaced by something that would work on jQuery's document.ready. Examples given here:

http://stackoverflow.com/questions/761148/jquery-document-ready-and-document-write

With .append, for example, it seems easy to load whatever you want, wherever you want it and then execute it after the page has loaded.
Webbo Posted - 24 June 2015 : 02:16:59
It basically sets the zone for the banner advert and calls the relevant banners for that zone.

Looking into JQuery there seems to be an issue using it and document.write if I've interpreted what I've read correctly :)

It's a shame that we cant use a <!--#INCLUDE FILE_After_everything_else="myfile.asp"--> command
ruirib Posted - 24 June 2015 : 00:26:08
It's not immediately clear to me what that piece of javascript is doing, other than generating another piece of javascript. With the available info, I am not sure what I described would be possible.
Webbo Posted - 23 June 2015 : 15:46:07
Hi Rui,

There are three includes altogether, one to place a banner in the header of the site, one to place banners within topic.asp and one to place a banner in the footer

As an example the include file for the header contains the following code:


<script type='text/javascript'><!--//<![CDATA[
document.MAX_ct0 ='INSERT_CLICKURL_HERE';
var m3_u = (location.protocol=='https:'?'https://www.mysite.com/openx/www/delivery/ajs.php':'http://www.mysite.com/openx/www/delivery/ajs.php');
var m3_r = Math.floor(Math.random()*99999999999);
if (!document.MAX_used) document.MAX_used = ',';
document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
document.write ("?zoneid=8&target=_blank&withtext=1&blockcampaign=1");
document.write ('&cb=' + m3_r);
if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
document.write ("&loc=" + escape(window.location));
if (document.referrer) document.write ("&referer=" + escape(document.referrer));
if (document.context) document.write ("&context=" + escape(document.context));
if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
document.write ("&ct0=" + escape(document.MAX_ct0));
}
if (document.mmm_fo) document.write ("&mmm_fo=1");
document.write ("'><\/scr"+"ipt>");
//]]>--></script>
ruirib Posted - 21 June 2015 : 23:42:02
In principle, what you could do is use jQuery to load the contents asynchronously and then add them to the part of the page you want. It's actually quite easy to do and you can do it by adding the javascript do it, at the bottom of the page, which means the page would load fully without being interrupted by the part loaded by the jQuery.
Basically this would mean that the banner would have to be loaded by jQuery and thus the include file would probably be ditched.

In order to understand if this is actually possible in your case, it would be needed to know what you load with the include file and it's possible that some small changes need to be done to the page that loads the banners, so that you can have some element that you can use to add whatever will be retrieved through jQuery.
Carefree Posted - 21 June 2015 : 21:52:58
Not possible. Include files are loaded before any of the script is executed. Your only solution is to minimize either the resolution or the size of the banner(s).

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000 Version 3.4.07