Sigh, it's due to the native getElementsByTagName call rather than
using element.select in the constructor. That'll teach me to copy code
without really understanding it... although it's a bit weird it worked
at all.

Thanks again for the help.

Cheers, Junk

On Apr 10, 5:56 pm, Junkshops <junksh...@gmail.com> wrote:
> Hi again,
>
> That was definitely one of the problems, thanks very much.
> Unfortunately IE still wants to make my life miserable as much as
> possible, the dirty bastard. Here's the new error that makes no sense
> to me:
>
> Webpage error details
>
> User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64;
> Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR
> 3.5.30729; .NET CLR 3.0.30729)
> Timestamp: Sun, 11 Apr 2010 00:46:41 UTC
>
> Message: Object doesn't support this property or method
> Line: 18
> Char: 3
> Code: 0
> URI:http://[redacted]/newsite/js/tabber.js
>
> Here's tabber.js:
> /*
>  * Borrows heavily (mostly? [entirely?]) from Fabtabulous:
>  *http://tetlaw.id.au/view/blog/fabtabulous-simple-tabs-using-prototype/
>  */
>
> var AjaxTabber = Class.create({
>         initialize: function(ele) {
>                 var ele = $(ele);
>                 this.menu = $A(ele.getElementsByTagName('li'));
>                 this.menu.each(this.setupTab.bind(this));
>                 var selected = this.menu.detect(function(elm) {
>                         return (elm.hasClassName('selected'));
>                 });
>                 this.show(selected);
>         },
>
>         setupTab: function(element) {
>                 element.observe('click', 
> this.activate.bindAsEventListener(this));
>         },
>
>         activate: function(ev) {
>                 var elm = Event.findElement(ev, 'li');
>                 Event.stop(ev);
>                 this.show(elm);
>                 this.menu.without(elm).each(this.hide.bind(this));
>         },
>
>         hide: function(elm) {
>                 $(elm).removeClassName('selected');
>         },
>
>         show: function(elm) {
>                 $(elm).addClassName('selected');
>                 var link = elm.down('a').readAttribute('href');
>                 link = 'ajax/' + link;
>                 $('centercontent').update('<div style="text-align:center"><img
> src="images/ajax-loader.gif"></div>');
>                 new Ajax.Updater('centercontent', link, {evalScripts: 'true',
> method: 'post'});
>         }
>
> });
>
> So the error is on the element.observe call in setupTab. But that
> looks fine to me... anyone kind enough to clue me in?
>
> Cheers,
>
> Junk
>
> On Apr 9, 11:39 pm, "T.J. Crowder" <t...@crowdersoftware.com> wrote:
>
> > Hi,
>
> > > Basically my js works fine in FF, IE8, and safari, but completely
> > > fails in IE6. The relevant source is below:
>
> > Nothing jumped out in the source (but then, there was virtually no
> > source to look at! :-) ), but usually this means you have a dangling
> > comma somewhere, like this:
>
> > var AjaxTabber = Class.create({
>
> >     initialize: function() {
> >         // ...
> >     },
>
> >     nifty: function() {
> >         // ...
> >     },
>
> >     spiffy: function() {
> >         // ...
> >     }, // <==== The problem is here
>
> > });
>
> > Most JavaScript implementations are fine with that, but IE6 and 7
> > choke on it (IE8 is fine). (The same is true of array literals.) I
> > *think* I read something from someone saying the new standard (5th
> > edition) says it should be supported (but don't quote me, I haven't
> > found that part of the spec yet) which may account for it being
> > supported in the new JScript engine in IE8, as Microsoft are much more
> > engaged than they've been in a decade.
>
> > Anyway, that's usually what causes this sort of thing, although the
> > error is usually "Expected identifier, string, or number". If you
> > don't find any of those, you'll probably have to post more code.
>
> > HTH,
> > --
> > T.J. Crowder
> > Independent Software Consultant
> > tj / crowder software / comwww.crowdersoftware.com
>
> > On Apr 10, 1:38 am, Junkshops <junksh...@gmail.com> wrote:
>
> > > Hi all,
>
> > > I'm very much a prototype/js newb and I'm working on my first site.
> > > I've searched around for an answer to this question but apparently my
> > > google-fu is weak. Hopefully someone here might be able to point me in
> > > the right direction.
>
> > > Basically my js works fine in FF, IE8, and safari, but completely
> > > fails in IE6. The relevant source is below:
>
> > > main html file header:
> > > <script type="text/javascript" src="js/prototype.js"></script>
> > > <script type="text/javascript" src="js/tabber.js"></script>
> > > <script type="text/javascript" src="swfobject.js"></script>
> > > <script type="text/javascript" src="js/scriptaculous.js?
> > > load=effects,builder"></script>
> > > <script type="text/javascript" src="js/lightbox.js"></script>
> > > <script type="text/javascript" src="js/initSite.js"></script>
>
> > > tabber.js:
> > > /*
> > >  * Borrows heavily (mostly? [entirely?]) from Fabtabulous:
> > >  *http://tetlaw.id.au/view/blog/fabtabulous-simple-tabs-using-prototype/
> > >  */
>
> > > var AjaxTabber = Class.create({
> > >         //class code here
>
> > > });
>
> > > initSite.js:
> > > document.observe('dom:loaded', function() {
> > >         new AjaxTabber('tablist');
> > >         //more irrelevant code here
>
> > > });
>
> > > When I enable debugging in IE6 and load the site I get the following
> > > error in a popup dialog: "Line 3, Char 2. Error: 'AjaxTabber' is
> > > undefined. Code: 0". Curiously the line number given for the error
> > > doesn't match the location of the AjaxTabber text in either of the
> > > files above, but those two places are the only places in the codebase
> > > where that text appears.
>
> > > AjaxTabber clearly is defined earlier in the js load sequence, so I
> > > don't understand what's wrong. If anyone can offer me any advice I'd
> > > appreciate it.
>
> > > One final comment: This project has taught me how to hate. IE,
> > > specifically.
>
> > > Cheers,
> > > Junk

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to