Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

jsfiddle how do I store javascript then reference just the script?

I was trying to link to a github javascript file and found that there is an issue with them serving it as type text plain so that some browsers will have an issue with it.  I'd like to store a copy of the file in my jsfiddle account then link to just the js.  Is this possible?

For example, I coped the js file from https://raw.github.com/BorisMoore/jsrender/master/jsrender.js and placed it in a new fiddle then saved it. How can I  link to just the js?
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

You are going to click the external sources link on the left.  Use https://rawgithub.com/BorisMoore/jsrender/master/jsrender.js instead of https://raw.github.com/BorisMoore/jsrender/master/jsrender.js
Just note, https://rawgithub.com/ 

The Caveat

Use this for testing and for sharing demo code with friends, but don't use it for anything production-related. It's slow, it might break from time to time, and it's intended as a convenience for development, not free static hosting.

If you send production traffic to rawgithub.com, evil things will happen to your site. You've been warned!

Wanna see who's using (and abusing) rawgithub.com? Check out the live usage stats!
Avatar of jackjohnson44
jackjohnson44

ASKER

Hi,
Sorry for my confusing post.  I was saying that instead of pointing to github or someone's repository someplace I wanted to add a js file myself to jsfiddle then reference it from a different page.

So I would make one file called file1.js on jsfiddle, then on another fiddle I could reference it.  This is independent of github or jsrender, that was just an example.  I am just looking to host a file in jsfiddle then reference it from another fiddle.  That way I can have several fiddles point at the same file.
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial