473,654 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding Javascript Script element in Rich Text Editor

1 New Member
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
1 2033
acoder
16,027 Recognized Expert Moderator MVP
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

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

Similar topics

15
12362
by: crjunk | last post by:
I have 4 TextBoxes on my form that I'm trying to add together to get a grand total. Here is the code I'm using: <SCRIPT LANGUAGE="JavaScript"> <!-- Beginning of JavaScript - function calcTotalPub() { var tempFed = +document.Form1.value; var tempState = +document.Form1.value;
1
3742
by: IkBenHet | last post by:
Hello, I found this script to create a simple rich text form (http://programmabilities.com/xml/index.php?id=17): <html> <head> <title>Rich Text Editor</title> </head> <body>
2
1593
by: Web Team | last post by:
Hi All, I'm in the process of writing a eich text editor web custom control. The actual text/HTML is displayed/editied in a DIV layer, which I have created like this: output.Write("<span class=" & EditDivCSSClass & " id=" & Me.ID & " " & strContentEditable & " wrap>" & _strText & "</span>")
2
3107
by: Muzzy | last post by:
Hi, I've used information on these newsgroups to build many pages. So I thought that now that I have my script working (something that I've been working on for about a week), I should post it so that it may help others. If posting this script is against the rules in this group then please accept my appologies. I developped this script so that I can add and remove rows in a table in which I have various input fields and I would use the...
1
2462
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this guy's Javascript "combo box" - http://sandy.mcarthur.org/javascript/select/select.html. It allows my users (when I get some!) to select from a list of preexisting options and also to add a new one by clicking on "add new". Essentially it's a select...
1
3290
by: carlg | last post by:
There seem to be plenty of Javascript implemented WYSIWYG editors for editing rich text in a web browser, but I haven't been able to find one that shows line numbers. Even if that was the only enhancement over the standard textarea object it would be great for my needs. Does anyone know of such a widget? Thanks, -Carl Gundel, author of Liberty BASIC
9
8408
by: Erwin Moller | last post by:
Hi, Can anybody comment on this? In comp.lang.php I advised somebody to skip using: <script language="javascript"> and use: <script type="text/javascript"> And mr. Dunlop gave this response:
36
9186
by: karen987 | last post by:
My newsweblog has ASP pages with news articles and a commenting system. The comments are posted, and to read them the reader clicks on the headline of the comment, and it opens up in a pop up window. I added this "whizzywig rich text editor" to the comments textbox where readers comment on articles. Whizzywig is a javascript rich text editor, and appears to work fine. I type the comment using the editor when i need to and then click...
11
5343
by: karen987 | last post by:
I have a web page which used to work fine until i added a rich text editor. the pages are in ASP and it is a news weblog, with a comments section where people click the headline of a comment and it opens into a pop up page ccalled "comment_view.asp" which has a reply button. If anyone wants to reply to the message, they click reply and it takes them to the parent page (view.asp) where there is a form for them to fill in,and submit the...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8593
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.