Hi David.
Your #1 advice works, thanks. Here below the .js code extract.
<script type="text/javascript">
var mediaList=[
<?php
$gallery = do_shortcode( '[mla_gallery attachment_tag="Anniversaire" attachment_category="Cartoon" post_parent=all size=full link=none mla_style=none orderby=rand]' );
$count = preg_match_all( '/src=(\"[^\"]*\")/', $gallery, $mla_matches );
if ( $count ) {
echo implode(",", $mla_matches[1]);
}
?>
];
alert(mediaList.join("\n"));
</script>
I’ll probably dig into the #2 advice as well, since I feel it’s a bit pity to format, then unformat the list.
Dimitri.