SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript class error?

    Hi, I'm getting a script error having something to do with a class in IE 5.5. I know absolutely nothing about Javascript. Here's my code:

    <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
    var tellafriend
    function TellAFriend() {
    self.name = "MainWindow";
    tellafriend = window.open('http://www.mysite.com/tellafriend', 'choose','width=445,height=320')
    tellafriend.focus()
    }

    </SCRIPT>

    Can you tell me what's wrong? Thanks!
    But what care I for praise? - Bob Dylan

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    chuck a ; at the end of all the lines that are nested- to be sure.
    I don't think it's that though.

    It works fine in my browser with or without those changes.

    Are you sure it's that that's causing the error?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    SitePoint Evangelist
    Join Date
    Nov 2000
    Posts
    427
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, when I click on the link that calls the javascript function, the window pops up, but there is no content in it whatsoever. A little yellow exclamation point appears on the bottom of the IE 5.5 browser and double clicking that and clicking details says:

    Line: 10
    Char: 9
    Error: Class not registered
    Code: 0

    When viewing the source in HTML-Kit, line 10 is the line that says "tellafriend = window.open(...)"

    Also, I'm not sure what you mean by the nested lines... I really know zero about Javascript or any real programming language I suppose.
    But what care I for praise? - Bob Dylan

  4. #4
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you got a url for the page. Often debuggers highlight the wrong line, or perhaps even the wrong script!

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  5. #5
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have pointed this out before, there is no bug involved the error applies to IE5.5 - 6
    You just need to install the latest DirectX Engine 8.1

  6. #6
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mike - you're probably right ... BUT:
    I don't see how you can diagnose it as that problem from what's been said so far?!!?!?

    It could be any of fifty bugs which generate that error - some of which are actually scripting problems!

    What makes you so sure that it's this ( which i unfortunately have to concur with - it's most likely to be )

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  7. #7
    SitePoint Member
    Join Date
    Jun 2002
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Flawless

    Of course you are correct, it was a terrible generalisation of mine.

    As usual MS are being a little obscure about the problem. The error can occur to anyone that has upgraded to IE5.5 - 6, generally not new installations. The upgrade can remove files from the registry that allow the viewing of certain Javascript classes.

    Test the script in Netscape and IE5.5-6, if its ok in Netscape and not IE then installing the latest DirectX Engine resolves this.

    Mike
    Last edited by mikemc; Jul 8, 2002 at 12:34.

  8. #8
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I concur - Good answer Mike.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •