Displaying content specific to day of week javascript iframe

I have used this java script code more than 1 years to change daily lineup of tv channel it's simple and easy to use you can use this script for  ads, special discount rates for special days, change banners daily, make daily reminders, changing content daily, tip of the day and so on.

This script loads a different page into an iframe daily




















Script - Copy and paste the following code into your source code


 <script language="JavaScript1.2">  
 var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1  
 var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1  
 //Specify IFRAME display attributes  
 var iframeprops='width=552 height=1300 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"'  
 //Specify 7 URLs to display inside iframe, one for each day of week  
 var daycontent=new Array()  
 daycontent[1]="monday.html" //Monday content  
 daycontent[2]="tuesday.html" //Tuesday content  
 daycontent[3]="wednesday.html"  
 daycontent[4]="thursday.html"  
 daycontent[5]="friday.html"  
 daycontent[6]="saturday.html"  
 daycontent[0]="sunday.html"  
 //No need to edit after here  
 if (ie||dom)  
 document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')  
 var mydate=new Date()  
 var mytoday=mydate.getDay()  
 function dayofweek_iframe(){  
 if (ie||dom){  
 var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff  
 iframeobj.src=daycontent[mytoday]  
 }  
 }  
 window.onload=dayofweek_iframe  
 </script>  


Not the answer you're looking for? Please comment

Displaying content specific to day of week javascript iframe Displaying content specific to day of week javascript iframe Reviewed by Unknown on 11:50 PM Rating: 5

No comments:

Powered by Blogger.