Project API Docs

FAQ/Troubleshooting common problems

I get an error message that my key is missing or invalid.
You need a valid API key to use the API. If you do not have a key, contact us to get one. The key is a string of hex digits (numbers 0-9 and letters a-f) broken up by hyphens. Before loading the API, you must create an object micd containing a property key that is assigned a string with your API key. A common mistake is to put the key in micd.config instead of micd.

I get strange errors when using Cloudflare.
By default, the Cloudflare service attempts to rewrite JavaScript files so that they can be loaded asynchronously. This rewriting conflicts with the API's built-in loading process; disable it by adding the attribute data-cfasync="false" to the script tag that loads the API. (Examples on this page include the attribute.)

When I try to use API classes or functions, they are undefined.
The code new micd.View throws a Not a constructor error.
The most likely cause is that you are calling into the API before it is fully loaded. You need to define a micd.onReady function before loading the API and avoid using the API before this function has been called.

How do I access an editor's math content to store it on a server?
The Editor.value property lets you get or set the document content using a compact string format that you can store as desired. Note that this is a Unicode string and it must be transmitted and stored using an appropriate encoding. Using UTF-8 is strongly recommended.

Why are the cut/copy/paste buttons sometimes missing from the Editing palette?
The buttons are only available when loaded with a secure protocol in supported browsers. Typically this means that the buttons are only shown when using https. It should still be possible to copy and paste content using the standard keyboard shortcuts Ctrl+C and Ctrl+V (or ⌘ Command+C and ⌘ Command+V on macOS).

How do I restrict editors to a single line?
When creating the editor, pass the appropriate NewEditorOptions object to the constructor:

let ed = new micd.Editor({ singleLine: true });
let view = new micd.View(ed);
view.addToDom(document.body);

Back to contents

This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.