Forum Moderators: open

Message Too Old, No Replies

Closed element but an error in validation

         

toplisek

9:45 am on Oct 3, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have tested Javascript validation at testing website.

jQuery(document).ready(function()
{


jQuery("a.single_image").fancybox(
{
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'titlePosition': 'outside',
'overlayColor': '#000',
'overlayOpacity': 0.6
}
);




jQuery("a#videolink0").click(function()
{
jQuery.fancybox(
{
'padding': 0,
'autoScale': false,
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'titlePosition': 'outside',
'overlayColor': '#eee',
'overlayOpacity': 0.4,
'title': this.title,
'width': 800,
'height': 550,
'href': this.href.replace(new RegExp("([0-9])", "i"), 'moogaloop.swf?clip_id=$1'),
'type': 'swf'
}
);
return false;
}
);

}
);

If I understand I have to put } after 0.6 but validation will show an error.


Error: SyntaxError: missing } after property list
Source Code:
'overlayOpacity': 0.6}

What is correct actually?

not2easy

2:01 pm on Oct 3, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Have you tried it with:
'overlayOpacity': '0.6' 

instead of
'overlayOpacity': 0.6

(Note: I don't do js, but it is a general pattern.)

Fotiman

7:35 pm on Oct 3, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month




I have tested Javascript validation at testing website.

What website? May help for recreating the issue.
The code as you have it pasted above does not produce any errors, so I'd suspect the "testing website" validation is incorrect.

toplisek

7:42 am on Oct 21, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have started to validate all other javascript code.

There is not an error.

Thank you for all replies.