the javscript part of the code uses
$('.cloudinary-fileupload')
.fileupload({ ...});
this is not accurate by checking out the code in cloudinary_js, it should be
$('.cloudinary-fileupload')
.cloudinary_fileupload ({ ...});
which extended the options with headers: {"X-Requested-With": "XMLHttpRequest"}
the sample code only works because the cloudinary_js is calling .cloudinary_fileupload on every "input.cloudinary-fileupload[type=file]", however the dynamically appened input will not work as the sample shows.