Enable Javascript Execution in Preview

Last post 08-24-2008, 12:54 PM by Andrew Orr. 7 replies.
Sort Posts: Previous Next
  •  01-30-2008, 1:16 AM 36637

    Enable Javascript Execution in Preview

    I would like to allow javascript that is embedded in the code view to execute during preview.  I know that you can set EnableStripScriptTags to false so that the editor preserves the javascript.  However, I would like to go one step further and allow it to execute in the Preview.  Is there any way that I can do this?
     
    Thanks,
    Ryan
  •  01-30-2008, 10:12 AM 36651 in reply to 36637

    Re: Enable Javascript Execution in Preview

    Ryan,
     
    JavaScript cannot be executed in the editor preview dialog.
     
    Please use the following button instead:
     
     Preview preview the current page

    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

  •  01-30-2008, 11:22 AM 36654 in reply to 36651

    Re: Enable Javascript Execution in Preview

    I tried that and it still doesn't execute.  I added the following to my Default.config file:
     
     <security name="EnableStripScriptTags">false</security>
    Here is my test HTML code:
     
    <html><script>alert("test");</script> <body> Type here </body> </html> 
    I am testing in IE6 on Windows XP.
  •  01-31-2008, 1:44 AM 36679 in reply to 36654

    Re: Enable Javascript Execution in Preview

    warnickr,
     
    1. I just checked the code. The JavaScript execution is the preview dialog is also disabled.
     
    2. If you do need this funtion, it's better to create the custom dialog (Demo: http://phphtmledit.com/custombuttons-popup.php). When the dialog loads, call the following JavaScript API:
     
    getHTML()
    This method is used for retrieving the content of CuteEditor as HTML.
    Example:

    // get the cute editor instance
    var editor1 = document.getElementById('CE_Editor1_ID);

    // retrieving the content of Cute Editor as HTML
    var content = editor1.getHTML();
    alert(content );

     
    3.  <security name="EnableStripScriptTags">false</security>

    EnableStripScriptTags is not a security item. Please use the following method to set this property.
     
     

    Editor.EnableStripScriptTags Property

    Specifies whether to remove inject script before write the string into the db.

     


    Example Code

    <?php
             $editor=new CuteEditor();
             $editor->ID="Editor1";
             $editor->Text="Type here";
             $editor->FilesPath="CuteEditor_Files";
             $editor->EnableStripScriptTags=false;
             $editor->Draw();
             $editor=null; 

             //use $_POST["Editor1"]to catch the data
    ?>

     



    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

  •  01-31-2008, 2:08 AM 36682 in reply to 36679

    Re: Enable Javascript Execution in Preview

    I will give that a try.  I was thinking I could do something along those lines too, but I was hoping for something easier.
     
    After spending some time playing around with the editor and pouring over the forums, I really think that supplying the source code (without charging that steep source code license fee) would not only help your customers, but would also help you.  I think that you would find a lot of people to help you with fixes and improvements.  I know that I would have probably answered this question on my own and might have added an option or something.  Just a thought.
     
    Thanks,
    Ryan
  •  08-24-2008, 9:38 AM 43213 in reply to 36679

    Re: Enable Javascript Execution in Preview

    Adam,

    My web developers cannot seem to help me.   Essentially, I am trying to do similar things which is to enable javascript tags.  Currently, the following happens when I try to enter the HTML:



    Andrew C. Orr, CFP®, AIF®
    Independent Pension Fiduciary & President
    ORRGROUP Financial Planning, Education, & Advice
    201 East Pine Street
    Suite 450
    Orlando, FL 32801

    Fee-only & Objective...finally!

    321-332-7179 phone
    800-878-0773 fax
    [email protected] email

    www.ORRGROUP.com

    www.RightPath401k.com


  •  08-24-2008, 9:58 AM 43214 in reply to 36679

    Re: Enable Javascript Execution in Preview

    Well, that didn't work.  Lets try this..
     
     
     
     
     
    How can I enable javascript?  I am sure it is turned off but i am not a web developer, just handy with HTML.  Thank you for your help!
    Andrew

    Andrew C. Orr, CFP®, AIF®
    Independent Pension Fiduciary & President
    ORRGROUP Financial Planning, Education, & Advice
    201 East Pine Street
    Suite 450
    Orlando, FL 32801

    Fee-only & Objective...finally!

    321-332-7179 phone
    800-878-0773 fax
    [email protected] email

    www.ORRGROUP.com

    www.RightPath401k.com


  •  08-24-2008, 12:54 PM 43216 in reply to 43213

    Re: Enable Javascript Execution in Preview

    Ok, I think I know what is happening.  I am running 5.1 when 6.1 is the current version.  Thus, I will look to update my software.
    Andrew C. Orr, CFP®, AIF®
    Independent Pension Fiduciary & President
    ORRGROUP Financial Planning, Education, & Advice
    201 East Pine Street
    Suite 450
    Orlando, FL 32801

    Fee-only & Objective...finally!

    321-332-7179 phone
    800-878-0773 fax
    [email protected] email

    www.ORRGROUP.com

    www.RightPath401k.com


View as RSS news feed in XML