Results 1 to 6 of 6

Thread: Prototype Error on line 1922 Re: Invalid Argument

  1. #1
    Join Date
    Feb 2009
    Location
    Virginia
    Posts
    21
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Prototype Error on line 1922 Re: Invalid Argument

    Hello you expert Lightbox people! Please help. I am using the Lightbox 2.0 by Lokesh D. I have figured out alot of errors I had with Lightbox, but cannot figure this one out. Here is the link to look at my site for the error:

    http://ambercakes.com/TagGraphicsAwardsTEST.html

    When I click on the only 1 image I have on my page, it comes up great with the lightbox and then I can X out of it, but at the bottom left of the page I see it says "error on page" then I try to click on the image again and the lightbox seems like it wants to come up but it is just a white box & when I double click that error on the bottom left, an error box comes up saying:

    Line: 1922
    Char: 9
    Error: Invalid Argument
    Code: 0
    Url: http://ambercakes.com/TagGraphicsAwardsTEST.html

    I found out that, that error is in the prototype.js file. I found on that line this coding:

    (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :

    Also, when I refresh the page it works then does the same thing again. I am using IE7. What do I need to change to have this lightbox working? I uploaded all the files needed & refreshed them. I'm not too familiar with all of this so please be thorough. I have been working on this for 3days now & nothing. Thanks for any help.
    Josie
    Last edited by ambercakes; 02-05-2009 at 07:36 PM. Reason: Put lightbox version

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It appears to be the image itself:

    Code:
    <a href="http://www.ambercakes.com/TagGraphics/bestpersawACtag.gif" rel="lightbox" title="Right click image than Save picture as">
    substitute another image, preferably a jpg.

    Now, it may be that the gif, being animated, never truly signals its onload event. Or, there could be something else wrong with it (from IE's point of view). Anyways, I re-saved it as an animated gif with no looping, and the error went away, then I re-saved it again as infinite looping and the error came back. Then I saved it with 13 loops - still had an error - unless I let the loops run out before closing it - go figure.

    However, it also appears that a workaround can be achieved, change (in prototype):

    Code:
        for (var property in styles)
          if (property == 'opacity') element.setOpacity(styles[property]);
          else
            elementStyle[(property == 'float' || property == 'cssFloat') ?
              (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
                property] = styles[property];
    to:

    Code:
        for (var property in styles)
          if (property == 'opacity') element.setOpacity(styles[property]);
          else /*@cc_on @*/
    /*@if(@_jscript_version >= 5)
    try{
    @end @*/
            elementStyle[(property == 'float' || property == 'cssFloat') ?
              (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
                property] = styles[property];/*@cc_on @*/
    /*@if(@_jscript_version >= 5)
    } catch(e){};
    @end @*/
    Last edited by jscheuer1; 02-06-2009 at 03:24 AM. Reason: add workaround
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    ambercakes (02-06-2009)

  4. #3
    Join Date
    Feb 2009
    Location
    Virginia
    Posts
    21
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Thumbs up It worked!

    Wow, John! You are the man! You are absolutely right about the image being a gif. I redid it with a png image & it worked great. Who'd ever thought. That part was simple and I can not believe I could not get that one. LOL. But I put the code in you told me to put in the prototype and it worked like a charm. I have never seen those kind of characters put together like that. But, I really thank you so much for taking the time to help me out. I love this forum! Thanks again.

  5. #4
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can you please explain it a little of the changes in the script

  6. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by manasaguli View Post
    Can you please explain it a little of the changes in the script
    This basically just allows IE to skip this part in the code if it throws an error. However, depending upon why you are interested, I'd suggest using a different script altogether. What seems to be the issue?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #6
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hey John,

    I'm having the same problem as the others when attempting to launch a SWF file from a link. I tried your bit of code and it did in fact prevent the error, however the lightwindow starts to draw near the top-left corner of the screen and then it disappears. Everything continues to work fine in FF. Any ideas? I suspect that perhaps IE needs some of the code that your modification is commenting.

    Thanks,
    Adam
    Last edited by jscheuer1; 03-05-2009 at 03:56 AM. Reason: signature rule violation

Bookmarks

Posting Permissions

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