I cant export properly something from codepen

Hi everyone, I found a ready pen, I took it and exported it. But when I open the index file the animation does not play, why is that and how can I fix it?
Here is the pen: https://codepen.io/mudrenok/pen/XMobMa

How are you trying to view the file?

What do you mean? Im opening the file by unarchiving it by the zip and then opening the index.html

You can not load the external script unless you are running a local server.

EDIT: I did not notice the // instead of https:// as @kevinSmith points out.

When I export it and run the html file, I see this in the console:

GET file://cdn.jsdelivr.net/mojs/latest/mo.min.js net::ERR_INVALID_URL
script.js:2 Uncaught ReferenceError: mojs is not defined
at script.js:2:21

In the network tab I see that it is failing.

In the code is this:

  <script src='//cdn.jsdelivr.net/mojs/latest/mo.min.js'></script>

Searching online I found this site that offers this url:


When I sub that in, it works.

1 Like

Yeah, I guess just adding the https: would work, too.

Yeah both of these works just fine. Thank you all so much