Solved

javascript onload not opening new windows in IE6

Posted on 2009-05-12
4
281 Views
Last Modified: 2012-05-06
Code below works great for opening my pdf's in a new window so that my ajax code doesnt reset the page...but...not in ie6...any ideas?
function fNewPDFWindows ()  

{  

if (!document.getElementsByTagName) return false;  

var links = document.getElementsByTagName("a");  

for (var eleLink=0; eleLink < links.length; eleLink ++) {

	if (links[eleLink].href.indexOf('.pdf') !== -1) {

		links[eleLink].onclick =

		function() {

			window.open(this.href,'resizable,scrollbars');  

			return false;

			}

			var img = document.createElement("img");

			img.setAttribute("src", "includes/new-win-icon.gif");

			img.setAttribute("alt", "(opens in a new window)");

			links[eleLink].appendChild(img);  

			}

	   	}

	}   
 

function addLoadEvent(func)

{

var oldonload = window.onload;

if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { oldonload(); func(); } } }

addLoadEvent(fNewPDFWindows);

Open in new window

0
Comment
Question by:SystemApe
  • 2
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 24367458
pop-up blocker on?
0
 

Author Comment

by:SystemApe
ID: 24367568
Yes but still opens in same window when I turn it off
0
 
LVL 92

Expert Comment

by:objects
ID: 24370091
better off asking in the javascript zone, this ihas nothing to do with java

0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24370189
>                         window.open(this.href,'resizable,scrollbars');  

try

                        window.open(this.href,'mypdf', 'resizable,scrollbars');  


whats stopping you using a target in a tag
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
json example 39 131
Unable to start eclipse ? 17 128
JDeveloper 12c for 32 bit 4 68
javap bin 2 25
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now