Results 1 to 2 of 2

Thread: How to open _blank page links?

  1. #1
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to open _blank page links?

    1) Script Title: Random iframe content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndomiframe.htm

    3) Describe problem:
    //Specify random URLs to display inside iframe
    var randomcontent=new Array()
    randomcontent[0]="http://www.dynamicdrive.com"
    .
    .
    .

    How to open _blank page(a new window) links?(for example:"http://www.dynamicdrive.com")
    Last edited by winpeace; 11-04-2007 at 02:59 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    window.open('http://www.dynamicdrive.com','_blank');

    But most browser will block that unless it is used like so as part of the body of the page:

    Code:
    <a href="http://www.dynamicdrive.com"
    onclick="window.open(this.href,'_blank');return false;"
    >Dynamic Drive</a>
    That's because all modern browsers generally block pop ups not directly initiated by the user. Some even block those.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •