Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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
  #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)
  #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)


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 03:42 PM
Microsoft VBScript runtime (0x800A000D) stitch Classic ASP Basics 1 April 27th, 2006 02:23 PM
Microsoft VBScript runtime (0x800A01B6) texasraven Classic ASP Basics 24 June 24th, 2004 06:22 AM
Microsoft VBScript runtime (0x800A0009) ppenn Classic ASP Databases 2 December 15th, 2003 01:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.