Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: pop up window  (Read 2787 times)

0 Members and 1 Guest are viewing this topic.

ashish1241

  • Guest
pop up window
« 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>



« Last Edit: July 25, 2010, 12:12:53 PM by kpac »

kpac

  • Web moderator
  • Moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: pop up window
« Reply #1 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?