Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 9th, 2005, 11:58 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Microsoft JScript runtime (0x800A1391)

why do i get this error?

Error Type:
Microsoft JScript runtime (0x800A1391)
'navigator' is undefined
/mackenzie/asp/acrobat.js, line 15


with my code:


/************************************************** *****
ACROBAT DETECT
All code by Ryan Parman, unless otherwise noted.
(c) 1997-2003, Ryan Parman
http://www.skyzyx.com
Distributed according to SkyGPL 2.1, http://www.skyzyx.com/license/
************************************************** *****/

var acrobat=new Object();

// Set some base values
acrobat.installed=false;
acrobat.version='0.0';

if (navigator.plugins && navigator.plugins.length)
{
    for (x=0; x<navigator.plugins.length; x++)
    {
        if (navigator.plugins[x].description.indexOf('Adobe Acrobat') != -1)
        {
            acrobat.version=parseFloat(navigator.plugins[x].description.split('Version ')[1]);

            if (acrobat.version.toString().length == 1) acrobat.version+='.0';

            acrobat.installed=true;
            break;
        }
    }
}
else if (window.ActiveXObject)
{
    for (x=2; x<10; x++)
    {
        try
        {
            oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");
            if (oAcro)
            {
                acrobat.installed=true;
                acrobat.version=x+'.0';
            }
        }
        catch(e) {}
    }

    try
    {
        oAcro4=new ActiveXObject('PDF.PdfCtrl.1');
        if (oAcro4)
        {
            acrobat.installed=true;
            acrobat.version='4.0';
        }
    }
    catch(e) {}
}

acrobat.ver4=(acrobat.installed && parseInt(acrobat.version) >= 4) ? true:false;
acrobat.ver5=(acrobat.installed && parseInt(acrobat.version) >= 5) ? true:false;
acrobat.ver6=(acrobat.installed && parseInt(acrobat.version) >= 6) ? true:false;
acrobat.ver7=(acrobat.installed && parseInt(acrobat.version) >= 7) ? true:false;
acrobat.ver8=(acrobat.installed && parseInt(acrobat.version) >= 8) ? true:false;
acrobat.ver9=(acrobat.installed && parseInt(acrobat.version) >= 9) ? true:false;

______________

line 15:

if (navigator.plugins && navigator.plugins.length)

help....

www.crmpicco.co.uk
www.milklemonadechocolate.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old March 9th, 2005, 12:55 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

I don't know, which browser is this code running in? I usually write window.navigator but it shouldn't really matter., By the way, this line is particularly bad coding:
Code:
oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");
NEVER USE EVAL, should be:
Code:
oAcro=new ActiveXObject("PDF.PdfCtrl." + x);

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old March 9th, 2005, 12:57 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Just thought, you're not trying to run this server side are you? It will only work in a client side script block.

--

Joe (Microsoft MVP - XML)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft JScript compilation error '800a03ec' webXtreme Classic ASP Databases 8 November 17th, 2010 08:50 PM
Microsoft VBScript runtime (0x800A0005) mail1 Classic ASP Basics 4 March 27th, 2008 04:42 PM
Microsoft VBScript runtime (0x800A000D) stitch Classic ASP Basics 1 April 27th, 2006 03:23 PM
Microsoft VBScript runtime (0x800A01B6) texasraven Classic ASP Basics 24 June 24th, 2004 07:22 AM
Microsoft VBScript runtime (0x800A0009) ppenn Classic ASP Databases 2 December 15th, 2003 01:15 PM



All times are GMT -4. The time now is 10:14 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.