Trouble with onload function

Discussion in 'Javascript' started by jamierphelps@gmail.com, May 16, 2006.

  1. Guest

    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.
     
    , May 16, 2006
    #1
    1. Advertising

  2. Zifud Guest

    wrote:
    > 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:

    <URL:http://www.html.it/articoli/niftycube/index.html>


    > 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 '()'.



    --
    Zif
     
    Zifud, May 17, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fabio R.
    Replies:
    0
    Views:
    802
    Fabio R.
    Mar 25, 2005
  2. David Otton

    window.onload and body.onload differences

    David Otton, Nov 4, 2004, in forum: Javascript
    Replies:
    2
    Views:
    558
    Martin Honnen
    Nov 4, 2004
  3. Replies:
    5
    Views:
    262
    Thomas 'PointedEars' Lahn
    May 15, 2005
  4. Q
    Replies:
    7
    Views:
    132
  5. marco

    onload -->* no onload

    marco, Jun 22, 2006, in forum: Javascript
    Replies:
    7
    Views:
    207
    marco
    Jun 24, 2006
Loading...

Share This Page