Domready not working but load is

599 views
Skip to first unread message

gregoryt

unread,
Aug 28, 2008, 10:41:37 PM8/28/08
to MooTools Users
I am using mootools 1.2

I have a very complex page (lots of external JavaScript for ads and
tracking). I attached an event for domready to the window. This isn't
firing, however, the 'load' event is working fine. Has anyone
experienced similar behavior?

I am assuming that neither domready nor load would fire if there is
some type of page error that isn't registering with firebug. However,
as stated above, only domready isn't working. My page is currently
using doc type transitional, but I tested with strict as well which
doesn't seem to resolve the issue.

I have also tried attaching scriptalicious to the page, which has a
similar method to trigger on dom ready, this is working fine.

With mootools on domready, if I strip all html from the body tags the
domready will fire, are their any strictly prohibited html tags I
should be aware of?

thoughts?

thanks
-gregory

gregory tomlinson

unread,
Aug 28, 2008, 10:53:46 PM8/28/08
to MooTools Users
Okay, I resolved this by attaching to the document instead of the window

Was using:
window.addEvent('domready', function(){
    alert('hi');

});

Changed to and resolved in firefox

document.addEvent('domready', function(){
    alert('hi');

});

I have not tested yet in IE, hopefully this won't be an issue


thanks
-gregory
--
Ned Flanders: "I wish we lived in a place more like the America of yesteryear that only exists in the brains of us Republicans."
________________________________

Is Your Site Powered By foto eBook?
Get a foto eBook site today: http://fotoebook.com/

keif

unread,
Aug 29, 2008, 11:56:31 AM8/29/08
to MooTools Users
Just curious - are you testing locally? Do you have the page online
that can be looked at?

I've seen conflictions arrive from other JS and mootools, which
usually means loading the "random" JS after domready fires (this was
how SWFObject was worked with before their last update).

-kb

gregoryt

unread,
Aug 29, 2008, 3:54:37 PM8/29/08
to MooTools Users
I do have a test page, I spoke with another developer and contributor
to mootools and he helped identify that a script was being called into
the page that was hijacking domready -- also included a link to that
script. I cannot tell if the modifications made to this swfobject
script are doing the hijacking or if this is something internal to the
version of swfobject my company is using

http://gregorytomlinson.com/asylum/conversion/hp.html

http://www.aolcdn.com/ke/swfobject/aol_swfobject.js

Also, I have tested in IE and attaching to document for the domready
script does work - so it seems to be alternative in the short run
until I can work with the other teams at my company and get this
sorted out.

thanks
-gregory
Reply all
Reply to author
Forward
0 new messages