Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Need a script for ad management
Old 07-31-2008, 10:35 AM Need a script for ad management
Novice Talker

Posts: 12
Trades: 0
Hi,

I want to use iFrame script for ad management. I have gathered some codes from net, which is following:

=========================
Following code included between <head>...</head>
=========================
<script type="text/javascript">
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe", "myframe1", "myframe2", "myframe3", "myframe4", "myframe5", "myframe6", "myframe7"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
var getFFVersion=navigator.userAgent.substring(navigat or.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function dyniframesize() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById){ //begin resizing iframe procedure
dyniframe[dyniframe.length] = document.getElementById(iframeids[i]);
if (dyniframe[i] && !window.opera){
dyniframe[i].style.display="block"
if (dyniframe[i].contentDocument && dyniframe[i].contentDocument.body.offsetHeight) //ns6 syntax
dyniframe[i].height = dyniframe[i].contentDocument.body.offsetHeight+FFextraHeight;
else if (dyniframe[i].Document && dyniframe[i].Document.body.scrollHeight) //ie5+ syntax
dyniframe[i].height = dyniframe[i].Document.body.scrollHeight;
}
}
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
if (window.addEventListener)
window.addEventListener("load", dyniframesize, false)
else if (window.attachEvent)
window.attachEvent("onload", dyniframesize)
else
window.onload=dyniframesize
</script>

=======================

Now for the iFrame:
=======================
<iframe id="myframe1" src="myframe1.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; display:none"></iframe>
=======================

I am a webmaster and want to manage ads from a single html file, and don't want to place ads on every page manually. I don't know much about scripting language, but ofcourse know making simple html pages through Frongpage.

My question is, Is the above technique useful? Or, Can anyone hint/provide me some other useful codes for above operation.

Thanks.
Vj
Googleword is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-31-2008, 06:54 PM Re: Need a script for ad management
Novice Talker

Posts: 12
Trades: 0
Above technique is good, but has problem sometimes.

1. ads taking time to load
2. sometime no iFrame is loaded, so empty iFrame, don't know why?

Anyone can suggest me any other technique, so that I can manage Ads. Actually, I have Tribal Fusion, CpmStar, CpxInteractive, Intergi, and Zedo. I don't want to place ads on all pages(1000+) manually. I used above technique but have two problems mentioned above.

Anyone can provide me the solution, or hint something.

Thanks,
Vj
Googleword is offline
Reply With Quote
View Public Profile
 
Old 07-31-2008, 09:07 PM Re: Need a script for ad management
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
With anything more than 3 or 4 ads, you need to apply a server side solution.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Need a script for ad management
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12037 seconds with 12 queries