Hi everyone,
I have created a lovely project which workes perfectly on all devices and browsers BUT IE8. It seems the troublesome code snippet comes from an object, that I create within my template and pass on as js-variable. It is generated like this:
<script>
var items = [<% loop GetSlides %>{"img": "<% with Slide %>{$Filename}<% end_with %>", "caption": "$Title"},<% end_loop %>];
</script>
and passes this on to my jQuery script-file:
var items = [{"img": "assets/Slides/ideas.jpg", "caption": "Funding Your Ideas"},{"img": "assets/Slides/ecommerce-portfolio-4.jpg", "caption": "Designing the Future of E-Commerce"},{"img": "assets/Slides/disruptive-technologies.jpg", "caption": "Redefining Markets with Disruptive Technologies"},{"img": "assets/Slides/market.jpg", "caption": "A New Generation of Marketplaces"},];
However IE8 cannot deal with the final, trailing comma and blocks all further scripting. I have tried slicing the last two characters from the sting and re-adding the ] as a quick and dirty approach with no luck. It seems to break the object. Is there a way to create the value of the object in php without the trailing comma or is there a "join"-method for the template I can use? Any ideas greatly appreciated!
Sam