I've found the cause of the problem: The images refered to in my carton_edge.js file were not found. That's because the image directory is calculated by the script using the site's base URL ending with index.php.
A solution is to override the image directory in the script with the full path to the images directory.
You'll find the image directory variable searching for "var im=" in the script