[Javascript] NEW WINDOW PROPERTIES...

Peter Brunone peter at brunone.com
Mon Dec 9 08:49:23 CST 2002


	Why not just make it

document.location.href = adURLs[thisAd];

instead?  There's no reason to use window.open() if you're not opening a new
window.

-Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Dan Costea
|
|Modify this:
|
|function gotoAd ()
|{
|    document.location.href = window.open(adURLs[thisAd], 'sameWin');
|}
|
|You have to use a target name ('sameWin') each time you open a window, if
|you don't want more windows to be opened.
|
|Dan.
|
|----- Original Message -----
|From: "Cheran" <jegadcheran at yahoo.com>
|To: <javascript at LaTech.edu>
|Sent: Monday, December 09, 2002 8:09 AM
|Subject: [Javascript] NEW WINDOW PROPERTIES...
|
|
|> Hi,
|> The following code works fine for a rotating banner with each banner
|> has different links and opening in a new window. so on clicking a
|> each banner it will open in a seperate window. but the links has to
|> open in a same one window. can it be done??
|> Regards,
|> Cheran
|>
|> <html>
|> <head>
|> <title>Banner Demo</title>
|> <script type="text/javascript">
|>
|> if (document.images)
|> {
|>
|>     adImages = new Array("banner1.jpg",
|>                          "banner2.jpg",
|>
|>                          "banner3.jpg");
|>
|>     adURLs = new Array("http://www.devhood.com",
|>                        "http://www.yahoo.com",
|>                        "http://www.google.com");
|>
|>     thisAd = 0;
|> }
|>
|> function cycleAds()
|> {
|>     if (document.images)
|>     {
|>         if (document.adBanner.complete)
|>         {
|>             if (++thisAd == adImages.length)
|>                 thisAd = 0;
|>
|>             document.adBanner.src = adImages[thisAd];
|>         }
|>     }
|>
|>
|>     setTimeout("cycleAds()", 1300);
|> }
|>
|> function gotoAd()
|> {
|>
|> document.location.href = window.open(adURLs[thisAd]);
|>
|> }
|> </script>
|>
|> <body bgcolor=ffffff onload="cycleAds()" >
|> <a href="#" onClick="javascript:gotoAd();" >
|> <img name="adBanner" src="banner1.jpg" border="0" alt="Click here to
|> visit these links" ></a>
|>
|> </body>
|> </html>
|>
|> __________________________________________________
|> Do you Yahoo!?
|> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
|> http://mailplus.yahoo.com
|> _______________________________________________
|> Javascript mailing list
|> Javascript at LaTech.edu
|> https://lists.LaTech.edu/mailman/listinfo/javascript
|
|_______________________________________________
|Javascript mailing list
|Javascript at LaTech.edu
|https://lists.LaTech.edu/mailman/listinfo/javascript
|




More information about the Javascript mailing list