Page 1 of 1

Expected identifier, string or number

Posted: Mon Jun 20, 2011 5:34 pm
by jonathon
Hi

I'm having a problem with this piece of code in IE :( it works fine in FF, Opera, Google and I guess Safari as they run the webkit engine.

I can't seem to figure out why, the code in dreamweaver reports no syntax errors either. I suspect it's a rogue comma or something. Can anyone advise?
		window.addEvent('domready', function(e){	
			
			// option 1		
			var slides = [
				{
					image: 'home_slide1.PNG',	
				}, // Line 7 error??
				{
					image: 'chest1.jpg',
				},
				{
					image: 'treehouse1.JPG',
				},
				{
					image: 'barn_slide.JPG',
				},
				{
					image: 'treehouse2.JPG',
				},
				{
					image: 'bathroom1.jpg',
				},
				{
					image: 'joinery_slide.JPG',
				},
				{
					image: 'plans1.jpg',
				},
				{
					image: 'taps1.jpg',
				},
				{
					image: 'hand_made.JPG',
				},
				{
					image: 'forest1.jpg',
				},
				{
					image: 'kitchen3.JPG',
				},
				{
					image: 'river1.jpg',
				},
				{
					image: 'decking1.jpg',
				},
				{
					image: 'barn1.jpg',
				},
				{
					image: 'draw1.jpg',
				}
				
				
				
			];
			
			// option 2
			// var slides = $$('#blinds img');

			$('blinds').floom(slides, {
				slidesBase: 'slides/',
				sliceFxIn: {
					top: 20
				}
			});
			
		});
I get this error from IE:

Message: Expected identifier, string or number
Line: 7
Char: 5

Line 7 is noted above.

If anyone can help me, i'd be really grateful, thanks

Jonathon

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 5:40 pm
by jacek
Looks okay to me, have you tried the Ie debugger thing ? It may give more information.

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:02 pm
by jonathon
Cant find any warnings or errors for that particular file :S

I don't see why it's wrong either as they're all set out in that order and if that was an error on line 7 then surely all the other '},' would be errors....

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:04 pm
by Temor
It's probably just IE being silly, as always.

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:07 pm
by jonathon
Yes, I have no doubt, but it still needs to be fixed sadly else the page won't work :-(

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:18 pm
by jacek
Try removing the , from the end of these lines
image: 'home_slide1.PNG', 

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:19 pm
by jonathon
Problem, Solved I hope and think

Had to remove the trailing commas like so:
                    window.addEvent('domready', function(e){       
                           
                            // option 1            
                            var slides = [
                                    {
                                            image: 'home_slide1.PNG'      
                                    }, 
                                    {
                                            image: 'chest1.jpg'
                                    },
                                    {
                                            image: 'treehouse1.JPG'
                                    },
                                    {
                                            image: 'barn_slide.JPG'
                                    },
                                    {
                                            image: 'treehouse2.JPG'
                                    },
                                    {
                                            image: 'bathroom1.jpg'
                                    },
                                    {
                                            image: 'joinery_slide.JPG'
                                    },
                                    {
                                            image: 'plans1.jpg'
                                    },
                                    {
                                            image: 'taps1.jpg'
                                    },
                                    {
                                            image: 'hand_made.JPG'
                                    },
                                    {
                                            image: 'forest1.jpg'
                                    },
                                    {
                                            image: 'kitchen3.JPG'
                                    },
                                    {
                                            image: 'river1.jpg'
                                    },
                                    {
                                            image: 'decking1.jpg'
                                    },
                                    {
                                            image: 'barn1.jpg'
                                    },
                                    {
                                            image: 'draw1.jpg'
                                    }
                                   
                                   
                                   
                            ];
                           
                            // option 2
                            // var slides = $$('#blinds img');
     
                            $('blinds').floom(slides, {
                                    slidesBase: 'slides/',
                                    sliceFxIn: {
                                            top: 20
                                    }
                            });
                           
                    });
     


Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:19 pm
by jacek
Awesome :D

Re: Expected identifier, string or number

Posted: Mon Jun 20, 2011 6:20 pm
by jonathon
Yep this was the case :) Thanks for alls input