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?
[syntax=javascript]
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
}
});
});
[/syntax]
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
Expected identifier, string or number
Re: Expected identifier, string or number
Looks okay to me, have you tried the Ie debugger thing ? It may give more information.
Re: Expected identifier, string or number
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....
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
It's probably just IE being silly, as always.
Re: Expected identifier, string or number
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
Try removing the , from the end of these lines
[syntax=javascript]image: 'home_slide1.PNG', [/syntax]
[syntax=javascript]image: 'home_slide1.PNG', [/syntax]
Re: Expected identifier, string or number
Problem, Solved I hope and think
Had to remove the trailing commas like so:
[syntax=javascript]
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
}
});
});
[/syntax]
Had to remove the trailing commas like so:
[syntax=javascript]
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
}
});
});
[/syntax]
Re: Expected identifier, string or number
Yep this was the case Thanks for alls input