tinymce does not exist

I am attempting to integrate tinymce into an ASP.NET content page. The code functions properly when I test it in VisualStudio2008. However, when I deploy it to IIS, I encounter a javascript error stating 'Error: 'tinyMCE' is undefined'

<script src="tinymce/jscripts/tiny_mce/tiny_mce.js" type="text/javascript"></script>
<script type="text/javascript">
tinyMCE.init({
        // General options
        mode : "textareas",
        theme : "advanced",
        plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

        // Theme options
        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,

        // Skin options
        skin : "o2k7",
        skin_variant : "silver",

        // Example content CSS (should be your site CSS)
        content_css : "css/example.css",

        // Drop lists for link/image/media/template dialogs
        template_external_list_url : "js/template_list.js",
        external_link_list_url : "js/link_list.js",
        external_image_list_url : "js/image_list.js",
        media_external_list_url : "js/media_list.js",

        // Replace values for the template plugin
        template_replace_values : {
                username : "Some User",
                staffid : "991234"
        }
});
</script>


<textarea id="txtareaEmailEditor" name="content" rows="30" cols="100" runat="server" ></textarea>

EDIT: Upon investigating with firebug and checking under the net tab, I found

GET tiny_mce.js  503 Service Unavailable

UPDATE: Moving the script to the application folder resolved the 503 error, but the tinymce undefined error persists.

<script src="tiny_mce.js" type="text/javascript"></script>

This is the address on IIS


Following some guidance from a senior developer here, certain changes were made which resolved the issue: IIS -> ASP EnableParentPaths=true IIS -> Handler Mappings StaticFile enabled

Answer №1

The location of the

tinymce/jscripts/tiny_mce/tiny_mce.js
file is dependent on the page being viewed. If you are viewing it locally, chances are you are accessing it from a different path in IIS. To solve this issue, consider using an absolute path:

/tinymce/jscripts/tiny_mce/tiny_mce.js

Revised response following an updated query:

I have shifted the script to the application directory ...

<script src="tiny_mce.js" type="text/javascript"></script>
My IIS address is
svr-app-d1/MailServiceWeb/EmailTemplateEditor.aspx

Utilize

<script src="/tiny_mce.js" type="text/javascript"></script>
instead. Take note of the preceding / which denotes an absolute path.

Explanation:

When your page was accessed at

svr-app-d1/MailServiceWeb/EmailTemplateEditor.aspx
, it sought for tiny_mce.js within the MailServiceWeb directory (which proved to be inaccurate).

Answer №2

With guidance from an experienced developer on this platform, I was able to implement the necessary changes to resolve the issue. The key adjustments involved enabling EnableParentPaths=true in IIS and enabling StaticFile in Handler Mappings.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Converting flat data into a nested object using JavaScript

Exploring the realms of react/ES6, I encountered an intriguing anomaly while utilizing the reduce method to convert a flat array received from an API into a nested object structure. Although I was well-versed in map and filter functions, the concept of red ...

On hover, HTML5 animations smoothly transition a dashed border inward

I'm in the process of creating a drag and drop module and I want to ensure that as the user drags an item, the dashed line around the outside moves inward and the box changes color. However, I don't want the appearance of the dashed line to chang ...

Extend and retract within a row of a table

I need help with modifying a dynamically generated table to meet specific requirements. The table currently looks like this. The task involves hiding all columns related to Category B, eliminating duplicate rows for Category A, and displaying entries from ...

Prevent non-existing page errors in ASP.NET by customizing endpoint handling to either disable the default endpoint not found

My current webservice URL is: http://www.example.com/service.svc/whatever Due to the endpoint not existing, I am presented with a page displaying the following message: The specified endpoint cannot be found. Please refer to the service help page for g ...

Identify the following map based on the sequence in the mapsOrder array

I have two arrays, mapsOrder and mapsData, containing objects: let mapsOrder = [1,2,1,3]; let mapData = [ { id: 1, gates: [ { toId: 2, coords: { x: 2, y: 42 } }, { toId: 3, ...

Issues with Django Site Search Functionality

Currently working on a Django project, I have encountered an issue with the search bar on my localhost site. Despite adding the search bar, it fails to return any results when provided input. Upon inspecting the page source, I discovered some unfamiliar li ...

Arrow functions in ECMAScript 6

var createTempItem = id => ({ id: id, name: "Temporary Product" }); I understand that the arrow function above is the same as: var createTempItem = function(id) { return { id: id, name: "Temporary Product" }; }; However, I am ...

The antithesis of a feature that encapsulates a chosen area with a span

Hi everyone, I have a function that works as follows: define(function () { 'use strict'; var sel, range, span; return function () { span = document.createElement("span"); span.className = 'highlight'; if (window.ge ...

The jQuery function throws an Error that is not caught by the surrounding try / catch block

Recently, I've been enhancing error handling in my JavaScript objects that heavily utilize jQuery. However, I've run into an issue where throwing a new Error from within a jQuery method is not caught by the surrounding catch statement. Instead, i ...

Why does my camera suddenly switch to a rear-facing view when I begin my Zoom meeting?

I am facing an issue with my camera function where it initially starts off facing backwards, but as soon as I perform the first scroll, it flips around and works correctly. Please note that I am a beginner in coding. Kindly be aware that there is addition ...

Unresolved peer dependency issue in NPM recursion

I'm attempting to enhance my @ionic-native/core in order to facilitate the installation of an OIDC client. Regardless of the commands I've attempted, I consistently encounter an error: UNMET PEER DEPENDENCY @ionic-native/[email protected] ...

Creating engaging animations with styled components in ReactJs

I have embarked on the journey of crafting a testimonial section that bears resemblance to the testimonials displayed on the website www.runway.com. Leveraging styled-components, I've made progress in piling up the cards at the center of the screen, w ...

In the realm of JavaScript with Express and Mongoose, it is important to ensure that all promises from Mongoose are executed

Currently, I am developing a forum API where each forum can have multiple threads, each thread can have multiple posts, and each post may have many replies. To establish these relationships, I have defined the schema as follows: var PostSchema = new Sche ...

Clicking on an Angular routerLink that points to the current route does not function unless the page is re

Currently, I am working on an E-commerce project. In the shop page, when a user clicks on the "View More" button for a product, I redirect them to the product details page with the specific product id. <a [routerLink]="['/product-details' ...

What is the best method for presenting nested JSON data in React using a key-value pair format?

This component serves as the product description section with tabs for both description and details. Selecting the description tab displays the product specifications in a tabular format. We are utilizing the Axios library to fetch JSON data from an API. I ...

Simple steps to change the appearance of the delete button from an ajax button to an html button

I need help transitioning the delete button from an ajax button to an html button in my code. Currently, the delete button functions using ajax/javascript and when clicked, a modal window pops up asking for confirmation before deleting the vote. However, ...

How do I determine in Selenium if I have successfully scrolled to the bottom of the page?

Imagine a situation where a list of elements is loaded dynamically in chunks at runtime. Whenever you scroll the page, more data is fetched and displayed. I am currently looking for a way to determine if I have reached the bottom of the page after scroll ...

Passport - Pairing Plan "Error|The username provided for sign_request() is not recognized"

Currently experimenting with duo in node.js using passport to test its implementation in an application....Utilizing a passport-duo strategy and encountering issues when trying to apply the example provided in my own project. The GitHub repository for pass ...

There seems to be a glitch in my JavaScript for loop as it is not iterating for the correct amount that it should

It seems like my for loop is not always iterating 7 times as intended. Sometimes it runs with 5 iterations, other times with 4 or 3. This is the JavaScript code I am using: var start = new Date().getTime(); var end = new Date().getTime(); function timeT ...

Retrieve information stored in a component's data variable

After creating a Vue repository using vue init webpack my-app My main.js file looks like this -- // The Vue build version to load with the import command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue fro ...