• Home
  • Services
    • Website Redesign / Refresh
    • Website Development
    • Responsive Website Design
    • eCommerce Web Design
    • Search Engine Optimization
    • Website Maintenance Services
    • Multimedia Website Design
    • Social Networking
  • cPanel Web Hosting
    • Basic Web Hosting
    • Standard Web Hosting
    • Premium Web Hosting
    • Reseller Web Hosting
    • Frequently Asked Questions
  • Computer Repair
    • Linux OS Installs
  • Webmaster Tools
    • Password Encryption Utility
    • Domain Name Whois
    • RGB and HEX Color Charts
    • Robots.txt Generator
    • Meta Tag Generator
    • CSS Button Generator
    • Source Code Encryption
  • WebLog
Web Hosting Login
Login

Login
Central Montana Web Design - ReddWebDev
  • Home
  • Services
    • Website Redesign / Refresh
    • Website Development
    • Responsive Website Design
    • eCommerce Web Design
    • Search Engine Optimization
    • Website Maintenance Services
    • Multimedia Website Design
    • Social Networking
  • cPanel Web Hosting
    • Basic Web Hosting
    • Standard Web Hosting
    • Premium Web Hosting
    • Reseller Web Hosting
    • Frequently Asked Questions
  • Computer Repair
    • Linux OS Installs
  • Webmaster Tools
    • Password Encryption Utility
    • Domain Name Whois
    • RGB and HEX Color Charts
    • Robots.txt Generator
    • Meta Tag Generator
    • CSS Button Generator
    • Source Code Encryption
  • WebLog
A simple free ad rotation script

A simple free ad rotation script

October 31, 2015 Coding

JavaScript

— may or may not be a solution you would prefer to use on your site these days — I guess it would depend on whether or not you would choose to embed someone elses script, or your own script, into your pages.

If you are the type that prefers to not use remote solutions when it comes to placing paid ads on your site, then this dandy jewel of a script just might do the trick.

First order of business is to bring up your standard text editor, whether it be Notepad or Leafpad, it doesn’t matter — Next you’ll be naming the file ‘ad-rotation.js’ — Copy and paste the code below into it:

—

gfx0=”http://www.yoursite.com/path/to/image.gif”;
lnk0=”http://www.advertiserswebsite.com/”;
alt0=”Advertisers Website”;

gfx1=”http://www.yoursite.com/path/to/image.gif”;
lnk1=”http://www.advertiserswebsite.com/”;
alt1=”Advertisers Website”;

gfx2=”http://www.yoursite.com/path/to/image.gif”;
lnk2=”http://www.advertiserswebsite.com/”;
alt2=”Advertisers Website”;

gfx3=”http://www.yoursite.com/path/to/image.gif”;
lnk3=”http://www.advertiserswebsite.com/”;
alt3=”Advertisers Website”;

gfx4=”http://www.yoursite.com/path/to/image.gif”;
lnk4=”http://www.advertiserswebsite.com/”;
alt4=”Advertisers Website”;

gfx5=”http://www.yoursite.com/path/to/image.gif”;
lnk5=”http://www.advertiserswebsite.com/”;
alt5=”Advertisers Website”;

len=6; // Number of banners

today=new Date();
today=Math.round(today.getTime()/10);
rnd=today%len;

// Edit the below for specific banner size
document.writeln(‘<a href=”‘+eval(“lnk”+rnd)+'” title=”‘+eval(“alt”+rnd)+'” rel=”external”><img src=”‘+eval(“gfx”+rnd)+'” alt=”‘+eval(“alt”+rnd)+'” width=”468″ height=”60″ /><br /></a>’);

—

Once you’ve edited the file above to reflect your paid (or otherwise) ads/links with the designated web addresses and banner sizes (if any) you’ll be saving it to your desktop so that you can load it to your js folder located in your website’s root directory.

Next, place the code below into the page where you want your rotating ads to appear:

—

<script type=”text/javascript” src=”js/ad-rotation.js”></script>
<noscript>JavaScript must be enabled to view this element</noscript>

—

Any questions? — Just let me know — Happy Coding

—

JavaScript

— The World’s Most Misunderstood Programming Language — According to Douglas Crockford, JavaScript, aka Mocha, aka LiveScript, aka JScript, aka ECMAScript, is one of the world’s most popular programming languages. Virtually every personal computer in the world has at least one JavaScript interpreter installed on it and in active use. JavaScript’s popularity is due entirely to its role as the scripting language of the WWW.

Despite its popularity, few know that JavaScript is a very nice dynamic object-oriented general-purpose programming language. How can this be a secret? Why is this language so misunderstood?

Here is more of what Douglas Crockford has to say on the matter of JavaScript .. Read More ..

 

Tags: ad rotationadvertisingcodingECMAScriptinternetjavascriptjs folderJScriptMochaLiveScriptweb design
Share
0

You also might be interested in

Creative people have better connected brains

Creative people have better connected brains

Jul 8, 2017

Highly creative people have significantly more nerve connections between the[...]

Bill ensures emails, photos won’t die with you

Bill ensures emails, photos won’t die with you

Sep 17, 2015

When you die, should your loved ones have access to[...]

World’s Largest Adserver

World’s Largest Adserver

Jan 16, 2012

  The writing was on the wall for Google, when[...]

Leave a Reply

Your email is safe with us.
Cancel Reply

You must be logged in to post a comment.




video
play-sharp-fill
Link

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Send Message
Experience the freedom of the Internet with your own Website Solution. Get Your Free Quote!


- internet web hosting
- linux server
- domain names
- dedicated ip's
- shared web hosting
- dedicated web hosting

Website Development

- forms and email
- jQuery sliders
- photo galleries
- image graphics rendering
- sitemaps xml
- social network integration
- website maintenance

Website Design

- website design
- website redesign
- website development
- ecommerce websites
- content management systems
- website rescue
- small business web design

Contacts

Great Falls, MT 59404

Phone: 406-788-4084

Friday - Sunday
8 AM – 8 PM MST

2023 © ReddWebDev.com

  • About
  • Contact
  • Acceptable Use
  • Privacy
  • Webmaster Tools
  • Previous Works – Portfolio
Prev Next