473,325 Members | 2,671 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,325 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 7552
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.