Question

I want to ask a question about jquery menu aim, then I have to put my code in jsfiddle with some external resources. I did this but it didn't work. Could any one tell what's wrong here?

Thanks.

Was it helpful?

Solution

You're linking to the github pages that display those files not the actual files that live on github. No, github isn't a CDN but it can absolutely be used to serve files.

As an example, try changing:
https://github.com/kamens/jQuery-menu-aim/blob/master/jquery.menu-aim.js
to
https://raw2.github.com/kamens/jQuery-menu-aim/master/jquery.menu-aim.js

and
https://github.com/kamens/jQuery-menu-aim/blob/master/example/css/bootstrap-responsive.css
to
https://raw2.github.com/kamens/jQuery-menu-aim/master/example/css/bootstrap-responsive.css

There are some issues with linking to files directly on github. Namely, everything is served as text/plain. As an alternative, you can use the http://rawgithub.com/ service. So the jQuery Menu link would become:
http://rawgithub.com/kamens/jQuery-menu-aim/master/jquery.menu-aim.js

Updated fiddle pointing at the correct github URLs: http://jsfiddle.net/X8w5M/12/

EDIT:
Note that the bootstrap CSS doesn't work in that fiddle because fiddle expects CSS to be served as text/css. Changing the bootstrap CSS link to http://rawgithub.com/kamens/jQuery-menu-aim/master/example/css/bootstrap.css brings it back to life.

EDIT 2
Here's a working fiddle with using rawgithub to serve the CSS and github to serve the JS. http://jsfiddle.net/X8w5M/18/

OTHER TIPS

Github is not a CDN. You have to use CDN links to embed external resources to jsfiddle. You can use the below links as external resources.

http://cdn.jsdelivr.net/jquery.menu-aim/0.1/jquery.menu-aim.min.js

http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css

http://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js

Try these.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top