MathQuil API Inclusion

239 views Asked by At

MathQuill seems to be particularly hard to include in our project, when we exactly follow the instructions off their website and we put:

<link rel="stylesheet" href="file:///mathquill-0.10.1/mathquill.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="file:///mathquill-0.10.1/mathquill.js"></script>

Our directory layout (the file the above code is in is landing.ejs) It does not work.The console errors when running the program. We think it is quite likely this is an issue with ejs although we are unsure of this and any help would be greatly appreciated.

2

There are 2 answers

2
Jonathan Woollett-light On BEST ANSWER

So I eventually found out the answer myself through a considerable amount of painful trial and error, ultimately the answer was or me to use the mathquill resources in my project in GitHub to create my own CDN using RawGit, I still have no idea why this works, but it does.

0
Han Seoul-Oh On

This has nothing to do with ejs or MathQuill, the error message in your console says:

Not allowed to load local resource: file:///

Is your page able to include any other JS or CSS files via file:///? If not, you need to use a local HTTP server, for example python -m SimpleHTTPServer. (You'll probably also want to use relative URLs to reference MathQuill's files, relative to the page.)

(I'm the maintainer of MathQuill.)