Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts

    Modal problems and onload events

    Hey all,

    I'm trying to add a modal dialog box on my web site and found a fairly easy - to -modify script (or so I thought) that does what I need in FF, but for some reason I get JS errors in IE.

    Here's a link to my dev site:

    http://65.162.44.76/yourlistonline.c...ic_html/modal/

    If you open this page in FF you should get a modal pop-up. However, in IE, I get an error on line 109..

    gPopupMask.style is null or not an object
    It seems that IE is choking on that line. I've tried several approaches,b but nothing seems to work. Does anyone have any idea what I might be missing? I've tried changing things from body onload="somfunction()" to moving the onload event the header (window.onload = somefunction but neither method works.

    If anyone could help, I'd be mighty appreciative. If anyone knows of another modal script that I can use that easily allows for onload calls, that would be good too.

    Thanks

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In FF I still get the error but it shows the modal box. So it is probably not a browser specific issue.

    david_kw

  • #3
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you calling initPopUp() somewhere before you try to show one? At first glance I didn't see it.

    david_kw

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Without looking at the source, a quick thing comes to mind that you can't use the style object unless you're using inline styles. Otherwise, it's null.

    Not sure if this is still true, maybe Kor can confirm?

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #5
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, I see it has

    addEvent(window, "load", initPopUp);

    I'm not sure how that works with

    window.onload = function () {}

    Which one would go first? Would one overwrite the other?

    Questions I don't know the answer to. But I do think the problem is your modelbox is being called before initPopUp.

    david_kw


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •