By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,871 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

Adding Javascript Script element in Rich Text Editor

P: 1
Hello MAtes,
I am having this problem of adding a script element in a rich text editor box.
i am doing this. The problem is that it won't add the script tag alltogather, or give an error "Unknown Runtime Error".
Its only with the script element as other elemets suscha s Div, img are all being added correctly.

Expand|Select|Wrap|Line Numbers
  1. editor = window.opener.document.getElementById('WebWizRTE');
  2. scr = editor.contentWindow.document.createElement('script');
  3. scr.setAttribute('type', 'text/javascript');
  4. scr.setAttribute('language', 'JavaScript');
  5. scr.innerHTML('var a;');
  6. editor.getElementById('myScript').appendChild(scr);
Mar 19 '07 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Welcome to The Scripts - TSDN.

Do you have this problem in all browsers or just IE/Firefox, etc.?

In IE, you may need to use the text property instead.
Mar 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.