By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

Re: Class not defined

P: n/a
Alberto meinte:
On 29 abr, 14:54, Gregor Kofler <use...@gregorkofler.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";alert(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.gregorkofler.at::: Landschafts- und Reisefotografiehttp://web.gregorkofler.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
Jun 27 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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

Thank you in advance.
Jun 27 '08 #2

P: n/a
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
Jun 27 '08 #3

P: n/a
Gregor Kofler meinte:
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
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
Jun 27 '08 #4

P: n/a
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?

Jun 27 '08 #5

P: n/a
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
Jun 27 '08 #6

P: n/a
It's working now.

A thousand thanks, Gregor and everybody.
Jun 27 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.