PDA

View Full Version : Prototype Error on line 1922 Re: Invalid Argument



ambercakes
02-05-2009, 07:31 PM
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

jscheuer1
02-06-2009, 03:10 AM
It appears to be the image itself:


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


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:


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 @*/

ambercakes
02-06-2009, 04:46 AM
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.

manasaguli
02-17-2009, 08:54 PM
Can you please explain it a little of the changes in the script

jscheuer1
02-18-2009, 05:32 PM
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?

adkoon
03-04-2009, 11:43 PM
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