Ad Issue (Putting it in a seperate frame?)

Status
Not open for further replies.

MistaC87

New Member
Messages
26
Reaction score
0
Points
0
Ok, I have an issue with the ads. It's not because they're on the page, its just that I use a website that's totally based upon flash technology, so only one ad is shown per visit. I would like to make a frame that can refresh itself every 15 or 20 seconds with a new ad using the script code given in the advertisement codes page.

Anybody have a Javascript code or HTML code that can tell the page to refresh itself every 20 seconds? Also, if it could be an embed frame inside of the page, that would be great.
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
Use setTimeOut or setInterval to call a function in Regular interval, and use window.location.reload()

- setTimeOut needs to be called again when the function exits.
 

MistaC87

New Member
Messages
26
Reaction score
0
Points
0
Ok I managed to get some help from my friend over MSN.

the code was easy to do.

All I did was put this in the index.html file:

Code:
<iframe src="ad.html" scrolling="No" allowtransparency="true" width="468" height="60" frameborder="No"></iframe>
then made an ad.html file with no margins and put this code in (the advertisement code is for corporate hosting.)

Code:
<SCRIPT LANGUAGE=JAVASCRIPT><!--
function contentrefresher(){ me='ad.html'; if( document.all ) location.replace( me ); else location.href = me; }
setTimeout( 'contentrefresher()', 30000 );
--></script>
<script type="text/javascript" src="http://x10hosting.com/adserve.js?corporate"></script></font>
It refreshes the ad every 30000 milliseconds, aka 30 seconds.

If you want no margins, just put this between your title and head tags:
Code:
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style>

Example of all of these codes implemented and live are at my website, http://mcstudios.x10hosting.com.
 
Last edited:

Swiblet

New Member
Messages
1,114
Reaction score
0
Points
0
Looks like the problem's fixed. Am I right? =)

~~B3N
 
Status
Not open for further replies.
Top