Re: Class not defined

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gregor Kofler

    Re: Class not defined

    Alberto meinte:
    On 29 abr, 14:54, Gregor Kofler <use...@gregork ofler.atwrote:
    >Alberto meinte:
    >>
    >>Hi,
    >>I've implemented a customized autocompleter using prototypes and it
    >>actually works like a charm in Firefox, but in IE 6/7 it just doesn't
    >>work because that infernal thing says that 'Autocomp' (the class i
    >>created for the autocompleter) is 'not defined'.
    >>It's kind of weird because I tried to show an alert before of the
    >>class definition but it is not shown even though the error is thrown
    >>at the instantiation of the autocompleter.
    >Classes in JS? No such thing...
    >
    FALSE, extending the prototype in JS is usually done to simulate OO
    behavior. Not real classes, but really useful ones.
    Still: No classes. Douglas Crockford will tell you about the differences
    between classes and prototypal inheritance.

    The confusing thing here is that IE seems to ignore the whole
    definition <scriptblock.
    I suppose because of the errors in the code. Pasting it into JSEclipse
    gives me:

    "missing formal parameter" and "identifier is a reserved word"

    Guess what? "class" is a reserved word - at least for IE.

    Entering:

    javascript:var class="42";aler t(class); into the adress field of IE gives me
    "Row 1 character 5 identifier expected ..."

    That was easy, wasn't it?
    >Seriously: What kind of help do you expect with such a problem
    >description? Using some library (one which is regularly scrutinized in
    >this NG) and posting no code whatsoever. Still, most likely the error
    >occurs somewhere *before* your instantiation of your autocompleter.
    >
    Well, not this kind of help of course. As I posted, I was googling,
    which also implies looking for info in groups, as this one. I usually
    don't need to post in groups asking about this kind of stuff, but
    look! Today I had to.
    With this attitude, the "problem" and your way to approach it, you sound
    like a script kiddie.
    Thanks anyway for posting.
    You're welcome.
    >--http://photo.gregorkof ler.at::: Landschafts- und Reisefotografie http://web.gregorkofle r.com ::: meine JS-Spielwiesehttp://www.image2d.com ::: Bildagentur für den alpinen Raum
    ....oh well, you hardly ever use usenet.

    Gregor


    --
    http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
    http://web.gregorkofler.com ::: meine JS-Spielwiese
    http://www.image2d.com ::: Bildagentur für den alpinen Raum
  • Alberto

    #2
    Re: Class not defined

    Hi again,

    Unfortunately, after following your advice it still remains the same.
    Pleas give a try if you don't mind from this package:



    Thank you in advance.

    Comment

    • Gregor Kofler

      #3
      Re: Class not defined

      Alberto meinte:
      Hi again,
      >
      Unfortunately, after following your advice it still remains the same.
      Pleas give a try if you don't mind from this package:
      >
      http://www.alu.ua.es/a/asb19/autocompleter.zip
      Are you sure, that you got the proper files? index.html has a typo,
      therefore it can't load autocomplete*r* .js

      Gregor



      --
      http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
      http://web.gregorkofler.com ::: meine JS-Spielwiese
      http://www.image2d.com ::: Bildagentur für den alpinen Raum

      Comment

      • Gregor Kofler

        #4
        Re: Class not defined

        Gregor Kofler meinte:
        Alberto meinte:
        >Hi again,
        >>
        >Unfortunatel y, after following your advice it still remains the same.
        >Pleas give a try if you don't mind from this package:
        >>
        >http://www.alu.ua.es/a/asb19/autocompleter.zip
        >
        Are you sure, that you got the proper files? index.html has a typo,
        therefore it can't load autocomplete*r* .js
        After fixing the typo: What am I supposed to see? In both IE and FF I
        get an input element. Finito. No errors, no AJAX, no nothing else.

        Gregor


        --
        http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
        http://web.gregorkofler.com ::: meine JS-Spielwiese
        http://www.image2d.com ::: Bildagentur für den alpinen Raum

        Comment

        • Alberto

          #5
          Re: Class not defined

          Sorry for the typo, but anyway, after correcting it, as you said it
          does not work, but only in Firefox, try again. That's funny. I've
          really seen this autocompleter working in Firefox, it never did in IE,
          but now, after mentioned corrections it fails in FF ('Autocomp is not
          defined') and seems to load in IE, but not working as it should.

          Package at http://www.alu.ua.es/a/asb19/autocompleter.zip has been
          corrected.

          Any ideas?

          Comment

          • Gregor Kofler

            #6
            Re: Class not defined

            Alberto meinte:
            Sorry for the typo, but anyway, after correcting it, as you said it
            does not work, but only in Firefox, try again. That's funny. I've
            really seen this autocompleter working in Firefox, it never did in IE,
            but now, after mentioned corrections it fails in FF ('Autocomp is not
            defined') and seems to load in IE, but not working as it should.
            >
            Package at http://www.alu.ua.es/a/asb19/autocompleter.zip has been
            corrected.
            Trying to help you, is *no fun*.

            "Autocomp is not defined" - index.html line 11. Firefox (and all others,
            too)
            Any ideas?
            Ok. Typo fixed. FF reports a 404 on the XHR response. Seems as if you
            fixed the wrong typo.
            Ok. Second typo fixed, path corrected.

            What now? Works ok in FF *AND* IE. What was your question?

            Gregor

            --
            http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
            http://web.gregorkofler.com ::: meine JS-Spielwiese
            http://www.image2d.com ::: Bildagentur für den alpinen Raum

            Comment

            • Alberto

              #7
              Re: Class not defined

              It's working now.

              A thousand thanks, Gregor and everybody.

              Comment

              Working...