Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I had the same problem for my project <a href="https://github.com/LarryBattle/Ratio.js">Ratio.js</a> and here's what I did.</p> <p><strong>Problem:</strong> Github.com prevents files from rendering/executing when the source is viewed by setting the content type/MIME to plain text.</p> <p><strong>Solution:</strong> Have a web page import the files. </p> <p><strong>Example:</strong></p> <p>Use <a href="http://jsfiddle.net">jsfiddle.net</a> or <a href="http://jsbin.com">jsbin.com</a> to create a webpage online then save it. Navigate to your file in Github.com and click the 'raw' button to get the direct link to the file. From there, import the file using the appropriate tag and attribute.</p> <pre><code>&lt;!DOCTYPE&gt; &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" /&gt; &lt;/head&gt; &lt;body&gt; &lt;h1 id="qunit-header"&gt;QUnit example&lt;/h1&gt; &lt;h2 id="qunit-banner"&gt;&lt;/h2&gt; &lt;div id="qunit-testrunner-toolbar"&gt;&lt;/div&gt; &lt;h2 id="qunit-userAgent"&gt;&lt;/h2&gt; &lt;ol id="qunit-tests"&gt;&lt;/ol&gt; &lt;div id="qunit-fixture"&gt;test markup, will be hidden&lt;/div&gt; &lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://raw.github.com/LarryBattle/Ratio.js/master/src/Ratio.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="https://raw.github.com/LarryBattle/Ratio.js/master/tests/js/Ratio-testcases.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Live Demo: <a href="http://jsfiddle.net/jKu4q/2/">http://jsfiddle.net/jKu4q/2/</a></p> <p><em>Note:</em> Note for jsfiddle.net you can get direct access to the result page by adding <code>show</code> to the end of the url. Like so: <a href="http://jsfiddle.net/jKu4q/2/show">http://jsfiddle.net/jKu4q/2/show</a></p> <p>Or....you could create a project page and render your HTML files from there. You can create a project page at <a href="http://pages.github.com/">http://pages.github.com/</a>.</p> <p>Once created you can then access the link through <code>http://*accountName*.github.com/*projectName*/</code> Example: <a href="http://larrybattle.github.com/Ratio.js/">http://larrybattle.github.com/Ratio.js/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload