The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.



Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Wed Mar 09, 2011 5:05 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Feb 12, 2010 5:13 pm
Posts: 131
Location: Prestatyn, North Wales
Hi there.

I've been working on a site for a client and this little error message has reared it's head and I can't seem to pinpoint it's cause;

Code:
window.addEvent is not a function

window.addEvent('domready', function(){ setlayout(); });


That is pretty much all Firebug will tell me. So far the only thing it's causing problems for is a popup system message that I believe is built into the template. I didn't have any involvement with the template and inital setup, so I'm going in blind here. My Javascript is poor at best too, so any help with this would be greatly appreicated!

I've done a lot of digging and the only solutions to problems similar to this I found were to change "domready" to "load", but that only seemed relevant in IE, and besides, it did nothing when I tried it anyway.

Can anyone help me out?

Thank you in advance! :)

_________________
"Buy land! They've stopped making it" - Mark Twain

http://www.antonydoyle.co.uk


Top
 Profile  
 
PostPosted: Thu Mar 10, 2011 3:13 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Apr 13, 2006 4:25 am
Posts: 1058
Location: Denver, Colorado, USA
You're calling window.AddEvent() before the mootools library is loaded.

_________________
Jim
website design, development, hosting and search engine optimization
http://www.IndustryWebHost.com


Top
 Profile  
 
PostPosted: Thu Mar 10, 2011 3:53 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Feb 12, 2010 5:13 pm
Posts: 131
Location: Prestatyn, North Wales
*self facepalm*

Thank you! It's all sorted now. :)

_________________
"Buy land! They've stopped making it" - Mark Twain

http://www.antonydoyle.co.uk


Top
 Profile  
 
PostPosted: Thu Mar 10, 2011 4:36 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Apr 13, 2006 4:25 am
Posts: 1058
Location: Denver, Colorado, USA
hey, I know what you're going through. I was using mootools with another framework. The framework was nice enough to be inconsistent on when it'd load my files. So on most pages everything worked fine, but then there were the other pages when things got rearranged.

_________________
Jim
website design, development, hosting and search engine optimization
http://www.IndustryWebHost.com


Top
 Profile  
 
PostPosted: Thu Mar 10, 2011 4:53 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Feb 12, 2010 5:13 pm
Posts: 131
Location: Prestatyn, North Wales
It is frustrating. The developer used an obscure template framework which just seems to clash at every opportunity with the Joomla core. It's so bad I almost recommended I just re-build the whole site!!

Thanks again for your help.

_________________
"Buy land! They've stopped making it" - Mark Twain

http://www.antonydoyle.co.uk


Top
 Profile  
 
PostPosted: Mon Mar 14, 2011 8:46 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Mar 14, 2011 8:40 am
Posts: 2
Hi,

I am newbie at this. Can somebody, please, explain me what to do to solve this problem?

Thanks in advance!


Top
 Profile  
 
PostPosted: Mon Mar 14, 2011 1:13 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Apr 13, 2006 4:25 am
Posts: 1058
Location: Denver, Colorado, USA
Sorry to hear that. Sometimes it's hard to know when to stop throwing good money (& time) after bad.

And for sons, the mootools.js library needs to be loaded before the addEvent() function is called.

_________________
Jim
website design, development, hosting and search engine optimization
http://www.IndustryWebHost.com


Top
 Profile  
 
PostPosted: Mon Mar 14, 2011 1:19 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Mar 14, 2011 8:40 am
Posts: 2
Hi,
Where to set that? In what file or ...

Thanks


Top
 Profile  
 
PostPosted: Mon Mar 14, 2011 2:14 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Apr 13, 2006 4:25 am
Posts: 1058
Location: Denver, Colorado, USA
The problem could actually be from anywhere, but the first place to check is the index.php file of your template.

Another good thing to do is look at the page source of your site to see what's calling the AddEvent function before mootools.js gets loaded (& joomla automatically includes mootools).

_________________
Jim
website design, development, hosting and search engine optimization
http://www.IndustryWebHost.com


Top
 Profile  
 
PostPosted: Mon Jul 25, 2011 3:23 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jul 06, 2010 12:35 pm
Posts: 41
I too am getting this problem on a custom template. As far as I can tell Joomla loads mootools anyway if it needs it so I don't know what to do. I'm trying to use ckforms module and the validation won't load. The code is as follows:

Code:
window.addEvent('domready', function(){
   var myTips = new Tips('.ckform_tooltip2', {
      initialize:function(){
         this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 250, wait: false}).set(0);
      },
      onShow: function(toolTip) {
         this.fx.start(1);
      },
      onHide: function(toolTip) {
         this.fx.start(0);
      }
   });


   var myForm = new FormCheck('ckform2', {
      fieldErrorClass : 'error',
      validateDisabled : true,
      display : {
         showErrors : 1,
         errorsLocation : 3,
         indicateErrors : 2,
         tipsPosition : 'right',
         addClassErrorToField : true,
         scrollToFirst : true
      },
      alerts : {
         required:'This field is required.',
         number:'Please enter a valid number.',
         email:'Please enter a valid email: <br /><span>E.g. yourname&#64;domain.com</span>',
         url:'Please enter a valid url: <br /><span>E.g. http://www.domain.com</span>',
         confirm:'This field is different from %0',
         length_str:'The length is incorrect, it must be between %0 and %1',
         lengthmax:'The length is incorrect, it must be at max %0',
         lengthmin:'The length is incorrect, it must be at least %0',
         checkbox:'Please check the box',
         radios:'Please select a radio',
         select:'Please choose a value'
      }

   })

   $(document.body).getElements('.captcharefresh').addEvents({
      'click': function(){
         if($chk($('captchacode'))) {
            $('captchacode').setProperty('src', 'index.php?option=com_ckforms&task=captcha&sid=' + Math.random());
         }
      }
   });

   
   
});



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 



Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group