I
Ian Sedwell
Hi guys
I am writing a Javascript routine to check for the presence and version of
an Adobe Acrobat PDFViewer on the user's machine. No problem with any
browser on the Mac, no problem with any browser on Windows - except MSIE.
However, I can write a routine in VBScript to cover the MSIE requirement. So
that's cool.
Both the js and vb elements work fine. So I have no problem with core
functionality.
Naturally, my js and vb scripts are in different files and I reference each
of these in the <head> of the HTML document that contains the js function
that makes the initial call.
The initial call is made to a js routine called "checkPDFViewer()". This
calls another js routine called "getAcrobatVersionJS()". This first of all
checks the platform and if it is not one that it knows about, it simply
returns -1. This result is the cue for "checkPDFViewer()" to call the vb
routine "getAcrobatVersionVB()".
Thus...
function checkPDFViewer () {
acrobatVersion = getAcrobatVersionJS();
if (acrobatVersion > -1) {
return true;
}
else {
acrobatVersion = getAcrobatVersionVB();
if (acrobatVersion > -1) {
return true;
}
else {
return false;
}
}
}
The problem is that I get an unknown object being thrown at me by MSIE.
What am I doing wrong? Like I say, individually the various code elements do
what they are supposed to do. I can run them in test harness HTML and they
return the results I expect. The problems arise when I try and work them
together.
Many thanks in advance
Ian
I am writing a Javascript routine to check for the presence and version of
an Adobe Acrobat PDFViewer on the user's machine. No problem with any
browser on the Mac, no problem with any browser on Windows - except MSIE.
However, I can write a routine in VBScript to cover the MSIE requirement. So
that's cool.
Both the js and vb elements work fine. So I have no problem with core
functionality.
Naturally, my js and vb scripts are in different files and I reference each
of these in the <head> of the HTML document that contains the js function
that makes the initial call.
The initial call is made to a js routine called "checkPDFViewer()". This
calls another js routine called "getAcrobatVersionJS()". This first of all
checks the platform and if it is not one that it knows about, it simply
returns -1. This result is the cue for "checkPDFViewer()" to call the vb
routine "getAcrobatVersionVB()".
Thus...
function checkPDFViewer () {
acrobatVersion = getAcrobatVersionJS();
if (acrobatVersion > -1) {
return true;
}
else {
acrobatVersion = getAcrobatVersionVB();
if (acrobatVersion > -1) {
return true;
}
else {
return false;
}
}
}
The problem is that I get an unknown object being thrown at me by MSIE.
What am I doing wrong? Like I say, individually the various code elements do
what they are supposed to do. I can run them in test harness HTML and they
return the results I expect. The problems arise when I try and work them
together.
Many thanks in advance
Ian