Problem:
Many Apache servers (like yours) have disabled resource-sharing with other servers by default. In your case, https://hydle.000webhostapp.com
is not allowed to share the .dae file with https://codepen.io
, which is why you're getting this error.
Solution 1:
If you host your code and your .dae file on the same server, you won't run into any CORS issues, since they both have the same origin.
Solution 2:
You'll need to upload a PHP script to your server that allows resource-sharing to specific domains. I won't write the whole code for you, but it goes something like this:
script.php:
<?php
header("Access-Control-Allow-Origin: https://codepen.io");
echo readfile("/path/to/file.dae");
?>
then you upload script.php to your server, and you'll be able to load that resource from codepen.io via JavaScript:
script.src = "https://hydle.000webhostapp.com/host/obj/script.php";
Accessing script.php
this way will return the contents of file.dae
. I don't recommend solution 2 because of security issues, but it's what you asked for. For more info on PHP's readfile, you can read its documentation.