Javascript is passing variable (object) by reference?

  •  04-19-2013, 9:31 AM

    Javascript is passing variable (object) by reference?


     function RichTextEditor_OnLoad(editor)
    {
          alert("onload: " + editor._config.uniqueid);
          editor.SetText(Controller.RTEAddOn_RTEField.value);
    }


    function RichTextEditor_OnTextChanged(editor)
    {
          alert(editor._config.uniqueid);
          Controller.RTEAddOn_RTEField.value = editor.GetText();
    }

     

    Hi,


    i am testing the Events on RichTextEditor. Both Events work and correctly called, but the content from the editor is not saved on the parameter I used before on Onload-Event.


    Probably this has something to do with the variable passing. If I am not mistaken, passing variable within object is "by reference", isn't it? But somehow the content from the editor is not saved in "Controller.RTEAddOn_RTEField.value".


    I would appreciate any help or information regarding this.


    Thanks in advance and best regards,


    Max 


View Complete Thread