Javascript changed!

Last post 10-30-2006, 3:17 AM by AlexCruddace. 4 replies.
Sort Posts: Previous Next
  •  10-26-2006, 5:39 AM 23836

    Javascript changed!

    Hi when saving the following script it gets altered and no longer works.
     
    before.
     
    function test(id) {
    var element = document.getElementById(id);
         
          for(var i = 0 ; i <element.childNodes.length; i++) {
                if(element.childNodes[ i].nodeType == 3) {
                      continue;
                }
                element.childNodes[ i].style.visibility = "hidden";
                element.childNodes[ i].style.position = "absolute";
    }
    }
     
    after see (red text).
     
     
    function colaps(id) {
    var element = document.getElementById(id);
         
          for(var i = 0 ; i <element.childnodes.length; i++) {
                if(element.childNodes[ i].nodeType == 3) {
                      continue;
                }
                element.childNodes[ i] .style.visibility = "hidden";
                element.childNodes[ i].style.position = "absolute";
    }
    }
     
    Any idea whats going on, and how do I stop this happening.
  •  10-26-2006, 11:49 AM 23842 in reply to 23836

    Re: Javascript changed!

    AlexCruddace,
     
    I can't reproduce this issue in the following link:
     
     
    Which version of CuteEditor are you using?
     
    This example is running version 5.3.
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-27-2006, 8:52 AM 23866 in reply to 23836

    Re: Javascript changed!

    Thanks for getting back.  I have managed to re-create this problem using the link provided.
    These are the steps I followed.
     
    Clicked on the link.
     
    Clicked to the HTML button/editor
     
    Inserted the code as such.
     
    <html>
        <head>
    <script>
    function test(id) {
    var element = document.getElementById(id);
         
          for(var i = 0 ; i <element.childNodes.length; i++) {
                if(element.childNodes[ i].nodeType == 3) {
                      continue;
                }
                element.childNodes[ i].style.visibility = "hidden";
                element.childNodes[ i].style.position = "absolute";
    }
    }
    </script>
        </head>
        <body>
            Type you JavaScript here:
        </body>
    </html> 
     
    Pressed the save button.
     
    The result showed me that the text was changed in both the editor and the text area below the submit button.
  •  10-27-2006, 1:40 PM 23874 in reply to 23866

    Re: Javascript changed!

     
    Thanks for the information.
     
    I can produce this bug by submiting the form in the HTML mode. We will investigate this issue and fix it as soon as possible.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  10-30-2006, 3:17 AM 23896 in reply to 23836

    Re: Javascript changed!

    Hi,
     
    If it helps I have found a work around which is this.
     
    function test(id) {
    var element = document.getElementById(id);
    var len = element.childNodes.length;
          
          for(var i = 0 ; i <len; i++) {
                if(element.childNodes[ i].nodeType == 3) {
                      continue;
                }
                element.childNodes[ i].style.visibility = "hidden";
                element.childNodes[ i].style.position = "absolute";
    }
    }
     
    Iv not tested this on the test link you used but it sovled the problem for me
View as RSS news feed in XML