Computer Hope

Internet & Networking => Web design => Topic started by: ashish1241 on July 25, 2010, 11:43:19 AM

Title: pop up window
Post by: ashish1241 on July 25, 2010, 11:43:19 AM
How do i get the links to open in new windows>>>>>>


Code: [Select]
<script language="JavaScript"><!--

//Javascript Created by Computerhope http://www.computerhope.com

//store the quotations in arrays

images = new Array(4);

images[0] = "<a href = 'http://www.yahoo.com'><img src='http://www.uniqueasindia.com/uploads/1/8/2/2/1822982/6553860.jpg?166' alt='Visit Computer Hope'></a>";

images[1] = "<a href = 'http://www.gmail.com'><img src='http://www.uniqueasindia.com/uploads/1/8/2/2/1822982/1396784.jpg?166' alt='Computer History'></a>";

images[2] = "<a href = 'http://www.computerhope.com/index.htm'><img src='http://www.computerhope.com/banners/banner3.gif' alt='Visit Computer Hope'></a>";

images[3] = "<a href = 'http://www.computerhope.com/newslet.htm'><img src='http://www.computerhope.com/banners/banner4.gif' alt='Computer Hope Newsletter'></a>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);

//done

// --></script><br>



Title: Re: pop up window
Post by: kpac on July 25, 2010, 12:14:47 PM
Please use the code BBCode tag when posting code in future.

Use the
Code: [Select]
target="_blank"attribute on all the <a> tags in the script.

Have you permission to copy that script?