Web Developers Forum & SEO Help
Web Developers ForumArticlesBlogLinks
topmenu

Programming and Scripts: Web Developers Forum

Go Back   TalkWebDev: Web Developers Forum for Web Designers & SEO Information > Web Development > Programming and Scripts
User Name
Password


Reply
 
Thread Tools Search this Thread
Old 07-15-2005, 09:31 PM   #1
TheRelief
TalkWebDev Junior
 
Join Date: Jul 2005
Posts: 1

Default Help!!! How to modify code...

I'm hoping someone out there can help. I am not a programmer so I'm not sure how or where to modify the script below so that when the banner link is clicked, it will open in a new browser window (leaving the original page open in its separate window).

Thanks in advance for your assistance!!!!

Here's the code:

<HTML><HEAD>
<TITLE>Rotating banners with links</TITLE>

<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -

if (document.images) {
ads = new Array(3);
ads[0] = "slipper_ad.gif";
ads[1] = "webnichebanner.jpg";
ads[2] = "sfcmp_ad.gif";
}

newplace = new Array(3);
newplace[0] = "http://www.silcom.com/~bevjack/"
newplace[1] = "http://www.webniche.com"
newplace[2] = "http://www.sfcmp.org"

var timer = null
var counter = 0

function banner() {
timer=setTimeout("banner()", 4000);
counter++;
if (counter >= 3)
counter = 0;
document.bannerad.src = ads[counter];
}

function gothere() {
counter2 = counter;
window.location.href = newplace[counter2];
}

// - End of JavaScript - -->
</SCRIPT>

</HEAD>
<BODY BGCOLOR="#FFFFFF" onload="banner()">

<a href="javascript:gothere()"><IMG SRC="webnichebanner.jpg" WIDTH="468" HEIGHT="60" BORDER="0" NAME="bannerad"></a>

</BODY>
</HTML>
TheRelief is offline   Reply With Quote
Old 07-17-2005, 07:56 PM   #2
Captain Cornflake
Prophet of 7ruth
 
Captain Cornflake's Avatar
 
Join Date: Mar 2005
Location: CT, USA
Posts: 41

Send a message via AIM to Captain Cornflake
Default

Now, I'm not very knowledgable in Javascript, but it looks like the code in the body is just a simple link. The piece of code in bold is what I added. Try this:

<a href="javascript:gothere()" target="_blank"><IMG SRC="webnichebanner.jpg" WIDTH="468" HEIGHT="60" BORDER="0" NAME="bannerad"></a>
Captain Cornflake is offline   Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial > PHP > Programming efficiency Purple Haze Programming and Scripts 0 06-09-2005 02:42 AM
CSS Layout tutorial Archaic Sage The Basics 0 04-27-2005 04:16 PM


All times are GMT. The time now is 06:01 PM.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

 
Admin CP Mod CP About Us Contact Us Top