Using Javascript in EditMe
EditMe's rich text editor does allow simple JavaScript insertion via the HTML view. If you attempt to paste JavaScript directly into the editor, it will be displayed on the page rather than executed as JavaScript.
You can use JavaScript in EditMe in four different ways:
- Option 1: Attach a .js file to your page and reference it with a <script src="..."></script> tag in your page. This is a good option if your JavaScript file is fairly fixed, and won't need to be edited a lot.
- Option 2 (recommended): Use a separate plain text edited page to manage the JavaScript. This allows you to manage the JavaScript using all the tools provided to EditMe pages, like versioning and easy editing. Then you can include the script page into any other page you like.
- Option 3: You can switch to the Code or Text editor modes of a normal page and paste in a SCRIPT tag containing JavaScript. When you switch back to the Rich Text Editor after adding JavaScript in the Text or Code Editor, the Rich Text editor will attempt to work around it. If your JavaScript becomes corrupted by the Rich Text editor, use Option 2 instead.
- Option 4: Use a plain text editing page and set the Serve Raw Page Content page property with the MIME Type of application/javascript. You can then use a <script> tag to include the page directly into your site's layout or into an individual page.