Monni Language Offline Min izāmō Posts: 413 Location: Kaarina, Finland Joined: Jul 16th, 2014 Gender: Mood: Frustrated Zodiac sign: JavaScript error Aug 17th, 2014 at 10:55am Mark & QuoteQuote Uncaught TypeError: Cannot read property 'complete' of undefined YaBB.js:448 resize_brd_images YaBB.js:448 onload YaBB.pl:351 Code Index: cgi-bin/yabb2/Sources/BoardIndex.pm =================================================================== --- cgi-bin/yabb2/Sources/BoardIndex.pm (revision 1534) +++ cgi-bin/yabb2/Sources/BoardIndex.pm (working copy) @@ -1203,11 +1203,11 @@ $imgid = $brd_img_id{$curboard}; if ( $bdpic =~ /\//ism ) { $bdpic = -qq~ <img src="$bdpic" alt="$boardname" title="$boardname" id="brd_id_$imgid" onload="resize_brd_images(brd_id_$imgid)" $brd_stylea$brd_w$brd_h$brd_styleb /> ~; +qq~ <img src="$bdpic" alt="$boardname" title="$boardname" id="brd_id_$imgid" onload="resize_brd_images(this);" $brd_stylea$brd_w$brd_h$brd_styleb /> ~; } elsif ($bdpic) { $bdpic = -qq~ <img src="$imagesdir/$bdpicfld$bdpic" alt="$boardname" title="$boardname" id="brd_id_$imgid" onload="resize_brd_images(brd_id_$imgid)" /> ~; +qq~ <img src="$imagesdir/$bdpicfld$bdpic" alt="$boardname" title="$boardname" id="brd_id_$imgid" onload="resize_brd_images(this);" /> ~; } if ( $boardname !~ m/[ht|f]tp[s]{0,1}:\/\//sm ) { Trick here is to use "this" instead of literal element id, because Chrome doesn't implicit cast the literal text as DOM object. Like usually omitting the semicolon makes Chrome fail miserably. « Last Edit: Aug 17th, 2014 at 12:36pm by Monni » GTalk Skype/VoIP Facebook Twitter YouTube ICQ IP Logged
Dandello Forum AdministratorYaBB Modder Offline I love YaBB 2.7! Posts: 2235 Location: The Land of YaBB Joined: Feb 12th, 2014 Gender: Mood: Annoyed Zodiac sign: Re: JavaScript error Reply #1 - Aug 17th, 2014 at 2:28pm Mark & QuoteQuote Thanks - learning more about js all the time. Edited: Just uploaded the fix here for testing Perfection is not possible. Excellence, however, is excellent. WWW IP Logged
Monni Language Offline Min izāmō Posts: 413 Location: Kaarina, Finland Joined: Jul 16th, 2014 Gender: Mood: Frustrated Zodiac sign: Re: JavaScript error Reply #2 - Aug 17th, 2014 at 2:48pm Mark & QuoteQuote Chrome seems to be more picky about things... But I guess all browsers that share same JavaScript engine are equally picky... Quick look at the integrated debugger in Chrome's Developer Tools revealed again pretty amusingly how Chrome tried miserably to recover from missing semicolon... GTalk Skype/VoIP Facebook Twitter YouTube ICQ IP Logged
Dandello Forum AdministratorYaBB Modder Offline I love YaBB 2.7! Posts: 2235 Location: The Land of YaBB Joined: Feb 12th, 2014 Gender: Mood: Annoyed Zodiac sign: Re: JavaScript error Reply #3 - Aug 17th, 2014 at 3:25pm Mark & QuoteQuote Picky isn't bad if it makes us write better code. Perfection is not possible. Excellence, however, is excellent. WWW IP Logged
Monni Language Offline Min izāmō Posts: 413 Location: Kaarina, Finland Joined: Jul 16th, 2014 Gender: Mood: Frustrated Zodiac sign: Re: JavaScript error Reply #4 - Aug 17th, 2014 at 3:57pm Mark & QuoteQuote I noticed you committed the fix to SVN but you forgot to add the semicolons. GTalk Skype/VoIP Facebook Twitter YouTube ICQ IP Logged
Dandello Forum AdministratorYaBB Modder Offline I love YaBB 2.7! Posts: 2235 Location: The Land of YaBB Joined: Feb 12th, 2014 Gender: Mood: Annoyed Zodiac sign: Re: JavaScript error Reply #5 - Aug 17th, 2014 at 4:19pm Mark & QuoteQuote Got the beggars this time. Perfection is not possible. Excellence, however, is excellent. WWW IP Logged
Monni Language Offline Min izāmō Posts: 413 Location: Kaarina, Finland Joined: Jul 16th, 2014 Gender: Mood: Frustrated Zodiac sign: Re: JavaScript error Reply #6 - Aug 17th, 2014 at 4:34pm Mark & QuoteQuote One more time... in trunk, the second change, the semicolon is now in wrong place... it is before ), when it should be after it... GTalk Skype/VoIP Facebook Twitter YouTube ICQ IP Logged
Dandello Forum AdministratorYaBB Modder Offline I love YaBB 2.7! Posts: 2235 Location: The Land of YaBB Joined: Feb 12th, 2014 Gender: Mood: Annoyed Zodiac sign: Re: JavaScript error Reply #7 - Aug 17th, 2014 at 4:42pm Mark & QuoteQuote And this is why having more than one set of eyes looking at the code is such a good thing. Perfection is not possible. Excellence, however, is excellent. WWW IP Logged
Monni Language Offline Min izāmō Posts: 413 Location: Kaarina, Finland Joined: Jul 16th, 2014 Gender: Mood: Frustrated Zodiac sign: Re: JavaScript error Reply #8 - Aug 17th, 2014 at 4:52pm Mark & QuoteQuote Yeah... When I write my own code, I write first, then think later... Sometimes it takes few hours to notice error in my own code, it happens sometimes after I have already turned off the computer or put it in sleep mode. I guess I have developed my own style of quality control during the 31 years I have developed programs. GTalk Skype/VoIP Facebook Twitter YouTube ICQ IP Logged
Dandello Forum AdministratorYaBB Modder Offline I love YaBB 2.7! Posts: 2235 Location: The Land of YaBB Joined: Feb 12th, 2014 Gender: Mood: Annoyed Zodiac sign: Re: JavaScript error Reply #9 - Aug 17th, 2014 at 7:11pm Mark & QuoteQuote Sometimes I realize I did something wrong when I'm out and about. Perfection is not possible. Excellence, however, is excellent. WWW IP Logged