Trouble with onload function

J

jamierphelps

I'm sure you guys are tired of seeing this kind of message, but this is
hopefully something a little different. I searched first.

I am using Drupal for a site and I also want to use Nifty Corners Cube
for styling purposes. On certain pages, Drupal adds its own onload
functions, so I am using the workaround built into NCC, the
NiftyLoad=function() method. It seems that the onload event is not
getting executed in Firefox Mac (the only other browser besides Safari
I can test on right now). The script fires off in Safari. Here is what
I have done to test so far.

1) Change from NiftyLoad to window.onload on a page where no other
onload attributes were called by Drupal.
2) Include a alert('okay'); call in the window.onload event for
debugging.

Neither of these yielded any joy. I hope someone out there has the
answer.

P.S. I think the same is happening with Firefox PC and IE 6 PC because
I had my wife test yesterday while at work and she said the corners
weren't rounded and the columns weren't the same height. I will test
this myself when I go to work later today.
 
Z

Zifud

I'm sure you guys are tired of seeing this kind of message, but this is
hopefully something a little different. I searched first.

I am using Drupal for a site and I also want to use Nifty Corners Cube
for styling purposes. On certain pages, Drupal adds its own onload
functions, so I am using the workaround built into NCC, the
NiftyLoad=function() method.

I guess you are talking about this stuff:

It seems that the onload event is not
getting executed in Firefox Mac (the only other browser besides Safari
I can test on right now). The script fires off in Safari. Here is what
I have done to test so far.
1) Change from NiftyLoad to window.onload on a page where no other
onload attributes were called by Drupal.
2) Include a alert('okay'); call in the window.onload event for
debugging.

Neither of these yielded any joy. I hope someone out there has the
answer.

What does the JavaScript console say?

Are you saying that onload function is not fired at all in Firefox?

Asking vague questions with no code and no error messages means you've
got little chance of decent help.

P.S. I think the same is happening with Firefox PC and IE 6 PC because
I had my wife test yesterday while at work and she said the corners
weren't rounded and the columns weren't the same height. I will test
this myself when I go to work later today.

The way to attach multiple load functions without stomping on others is
to use something like:

if (window.attachEvent) {
window.attachEvent('onload', functionRef);
} else if (window.addEventListener){
window.addEventListener('load', functionRef, false);
}

where functionRef is the name of the function (or some other reference
to it) without a following '()'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top