Javascript is passing variable (object) by reference?

Last post 04-19-2013, 12:31 PM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  04-19-2013, 9:31 AM 77248

    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 


  •  04-19-2013, 12:31 PM 77252 in reply to 77248

    Re: Javascript is passing variable (object) by reference?

     Hi mwinata,

     

    Are you using the editor under MVC site?

     

    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.

     

    Can you explain your issue in detail? What is the parameter you mean? And save at where? Can you create an example page which can reproduce this issue and post here? So we can try it directly.

     

    Regards,

     

    Ken 

View as RSS news feed in XML