smartNavigation throws error

  •  08-26-2004, 11:34 PM

    smartNavigation throws error

    I am having diffuclty when I have Cute Editor on a page and I set smartNavigation = True. I get an "Object doesn't support this property or method" error - the line number doesnt even relate to a line of Javascript, just base html, so i am clearly not getting any help there.

     
    Has anybody else noticed this?  Is this a known bug?
     
    [More Info]
    Did a bit more investigation - the editor adds some JS code to the page:
     

    <script language="javascript">

        var editing;

        for (var i = 0; i < g_state.length; i ++)

            g_state[i].Load();

        var submit_data = document.getElementById('frmMain').submit;

        document.getElementById('frmMain').submit = function() {

            for (var i = 0; i < g_state.length; i ++)

                save(g_state[i].UniqueID);

                submit_data();

        }

    </script>
     
    It looks like this error is being thrown because g_state[0] which is an instance of _CState, does not have its Load method defined.  In the watch window i put in:
        "Load" in _CState and I get false
        "open" in window returns true
     
    Looking at the WinIE.js, I see this can happen if Editor_prototype_called is already defined, but then you might expect the Load method to also be defined, as it is in the prototype.
     
    [More Info 2]
    As an excercise I modified the block of code in WinIE.js:

     

    if (typeof(Editor_prototype_called) == 'undefined') {

        Editor_prototype_called = true;

        _CState.prototype.Load = EditorLoad;

        _CState.prototype.EditorView = EditorView;

        _CState.prototype._Format = _Format;

        _CState.prototype.save = save;

        _CState.prototype.doRow = doRow;

        _CState.prototype.doColumn = doColumn;

        _CState.prototype.doCell = doCell;

    }

     
    to be as follows:
     

        _CState.prototype.Load = EditorLoad;

        _CState.prototype.EditorView = EditorView;

        _CState.prototype._Format = _Format;

        _CState.prototype.save = save;

        _CState.prototype.doRow = doRow;

        _CState.prototype.doColumn = doColumn;

        _CState.prototype.doCell = doCell;

     

        this.Load = EditorLoad;

        this.EditorView = EditorView;

        this._Format = _Format;

        this.save = save;

        this.doRow = doRow;

        this.doColumn = doColumn;

        this.doCell = doCell;

     
    and it now works just fine.
View Complete Thread