Javascript error Entering text in Content Editor Web Part in HTML Source Mode

On a demo that I am trying to work on, I kept coming across this javascript error while in HTML source mode on a CEWP instance.  It was annoying enough for me to go find a quick fix

The error itself was quite vague: " Object expected:  in /_layouts/RTE2PUEditor.aspx".

With the HTML editor being a modal, there was no easy way to figure out the offending source.

Googling the error description yielded some helpful links one of which mentioned a hacky fix that I promptly put in! Since this was a test box, I didn't really care about breaking the support model, but not a good idea on production boxes, period!

If you landed here looking for that fix, use the steps below to fix it quick:

1. Open up the HtmlEditor.js file underneath your layouts/1033 folder in the 12 hive C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033

2. Locate the entry for:

function RTE2_OnKeyDown(strBaseElementID, elem)

and change the following line:

RTE_ToggleEnableShortcuts(evtSource);

to:

//RTE_ToggleEnableShortcuts(evtSource);

try { RTE_ToggleEnableShortcuts(evtSource); } catch (e) {}

There you go! Do not forget to refresh (Control F5) your browser screen when you next test this as the Editor dialog may be cached. Screenshot for those looking for visuals.

Cheers!



Comments are closed

Tat Tvam Asi

Sanskrit: तत् त्वम् असि or तत्त्वमसि) translating variously to "Thou art that" "That thou art" or "That you are"

A Word a Day

Affiliations