473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

"Member not found" error when opening PDFs in new window

Why does if(win==null || win.closed) return true after one PDF is open.
Something very wierd going on with IE 6. I also get a member not
found error if a child window is already open. This script works fine
if the child window contains HTML, just not a PDF. Ideas? Note: These
are not my PDFs, I just found some on the Net so you could test.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
var win;
function winfocus(){
if(!(win==null || win.closed))
win.focus();
}

function newWindow(myurl,mywidth,myheight,resize){
var myDate=new Date();
var myTime=myDate.getTime();
var URL=((myurl.indexOf('?') -1))?myurl + '&time=' + myTime:myurl +
'?time=' + myTime;
var w=mywidth;
var h=myheight;
var winname='popWindow';
var winl = (screen.width - w) / 2, wint = (screen.height - h) / 2;
var
winresize=((resize=='resize'))?'scrollbars=yes,res izable=yes':'scrollbars=no,resizable=no';
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +
',toolbar=no,status=no,menubar=no,' + winresize;
if(win==null || win.closed)
win=window.open(URL, winname, winprops);
win.focus();
document.onclick=winfocus;
}
</script>
</head>
<p><a href="http://www.nsf.gov/pubs/2007/nsf07505/nsf07505.pdf"
onclick="newWindow('http://www.nsf.gov/pubs/2007/nsf07505/nsf07505.pdf',500,400,'resize');return
false"></a></p>
<p><a href="http://grants.nih.gov/grants/funding/phs398/biosketch.pdf"
onclick="newWindow('http://grants.nih.gov/grants/funding/phs398/biosketch.pdf',500,400,'resize');return
false"></a></p>
<body>
</body>
</html>

Nov 2 '06 #1
2 7556
johkar wrote:
Why does if(win==null || win.closed) return true after one PDF is open.
Something very wierd going on with IE 6. I also get a member not
found error if a child window is already open. This script works fine
if the child window contains HTML, just not a PDF. Ideas? Note: These
are not my PDFs, I just found some on the Net so you could test.
Sorry, here is correct HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
var win;
function winfocus(){
if(!(win==null || win.closed))
win.focus();
}

function newWindow(myurl,mywidth,myheight,resize){
var myDate=new Date();
var myTime=myDate.getTime();
var URL=((myurl.indexOf('?') -1))?myurl + '&time=' + myTime:myurl +
'?time=' + myTime;
var w=mywidth;
var h=myheight;
var winname='popWindow';
var winl = (screen.width - w) / 2, wint = (screen.height - h) / 2;
var
winresize=((resize=='resize'))?'scrollbars=yes,res izable=yes':'scrollbars=no,resizable=no';
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +
',toolbar=no,status=no,menubar=no,' + winresize;
if(win==null || win.closed)
win=window.open(URL, winname, winprops);
win.focus();
document.onclick=winfocus;
}
</script>
</head>
<body>
<p><a href="http://www.nsf.gov/pubs/2007/nsf07505/nsf07505.pdf"
onclick="newWindow('http://www.nsf.gov/pubs/2007/nsf07505/nsf07505.pdf',500,400,'resize');return
false">Link 1</a></p>
<p><a href="http://grants.nih.gov/grants/funding/phs398/biosketch.pdf"
onclick="newWindow('http://grants.nih.gov/grants/funding/phs398/biosketch.pdf',500,400,'resize');return
false">Link 2</a></p>
</body>
</html>

Nov 2 '06 #2

johkar wrote:
johkar wrote:
Why does if(win==null || win.closed) return true after one PDF is open.
Something very wierd going on with IE 6. I also get a member not
found error if a child window is already open. This script works fine
if the child window contains HTML, just not a PDF. Ideas? Note: These
are not my PDFs, I just found some on the Net so you could test.

Sorry, here is correct HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
var win;
function winfocus(){
if(!(win==null || win.closed))
win.focus();
}

function newWindow(myurl,mywidth,myheight,resize){
var myDate=new Date();
var myTime=myDate.getTime();
var URL=((myurl.indexOf('?') -1))?myurl + '&time=' + myTime:myurl +
'?time=' + myTime;
var w=mywidth;
var h=myheight;
var winname='popWindow';
var winl = (screen.width - w) / 2, wint = (screen.height - h) / 2;
var
winresize=((resize=='resize'))?'scrollbars=yes,res izable=yes':'scrollbars=no,resizable=no';
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +
',toolbar=no,status=no,menubar=no,' + winresize;
if(win==null || win.closed)
win=window.open(URL, winname, winprops);
win.focus();
document.onclick=winfocus;
}
</script>
</head>
<body>
<p><a href="http://www.nsf.gov/pubs/2007/nsf07505/nsf07505.pdf"
onclick="newWindow('http://www.nsf.gov/pubs/2007/nsf07505/nsf07505.pdf',500,400,'resize');return
false">Link 1</a></p>
<p><a href="http://grants.nih.gov/grants/funding/phs398/biosketch.pdf"
onclick="newWindow('http://grants.nih.gov/grants/funding/phs398/biosketch.pdf',500,400,'resize');return
false">Link 2</a></p>
</body>
</html>
I found the solution here: http://tinyurl.com/yd54h8

Nov 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ari Royce Hidayat | last post by:
Dear ALL, Is there some one ever faces this problem? And fix it? The scenario is: There's an html page that hosts a .net object (using object tag), and this page opens the second html page...
0
by: Ari Royce Hidayat | last post by:
Tx a lot for idea. I've tried it, and still get not clue what causes it. I also tried to see the log file generated by IEHost (by adding IEHostLogFile to registry) and still get not clue what...
4
by: mattsthompson | last post by:
Im writing a DLL that extends IHttpHandler to intercept requests for a certain file extension and deliver watermarked images. I'm using LeadTools' .NET framework for the image manipulation and it...
1
by: Kirk | last post by:
Hello, I have a very simple application that I am trying to publish to a Windows 2005 server. During my testing, I sucessfully published my application using ClickOnce to my local IIS. I...
1
by: Casper Stendal | last post by:
Is it some how possible to handle a "directory not found" error through ASP.NET (or ASP), without having to make speciel a setup for the application in IIS, when it comes from an URL without...
22
by: kkk1979 | last post by:
I am not an experienced programmer. I am getting an error as "method or data member not found" when i entered the following code in buttonclick procedure of the toolbar. select case button.key...
1
by: =?Utf-8?B?UGFsbHZp?= | last post by:
Hello friends, I am facing this problem("MEMBER NOT FOUND" error HRESULT : 0x80020003 (DISP_E_MEMBERNOTFOUND) ) in Visual Basic 2005 (i.e. VB .NET) for the fourth statement(ObjWb =...
8
by: webgenius | last post by:
Whenever I click the SUBMIT button in my HTML page, I get the "Object not found!" error. It was working fine yesterday. This error started to occur after I installed Codelobster and made some changes...
3
maliksleo
by: maliksleo | last post by:
hi all i m having this "The resource cannot be found." error. I applied the url rewriting on my project every page is being browsed very well but i am getting the above error an some pages i dont...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.