Solved

Free RTE ( http://freerichtexteditor.com/ ) . Problem preloading content.

Posted on 2008-10-29
1
1,777 Views
Last Modified: 2012-06-27
Hello Experts,

I am new to ASP and relatively new to JS, so I apologize for this silly question.

I have a problem preloading content to  Free Rich Text Editor( http://freerichtexteditor.com/ ).
I included all the requires files to my ASP page:

<script LANGUAGE="javascript" type="text/javascript" src="/Includes/JS/config.js"></script>
<script LANGUAGE="javascript" type="text/javascript" SRC="/Includes/JS/richtext.js"></script>

and initialized RTE in my <table></table> successfully:

<SCRIPT LANGUAGE=javascript>
initRTE(' ', ' ');
</SCRIPT>

Now I need to preload some content there. I have a variable on my page which is basically a value from the DB, which is generated dynamically and I can' hardcode it. The value of this variable is supposed to preload in the textarea of RTE.

I tried to initialize RTE like this, first parameter is supposed to be preloaded content.

<SCRIPT LANGUAGE=javascript>
initRTE('<%=myVariable%> ', ' ');
</SCRIPT>

But it didn't work.

At the same tme  initRTE('some text ', ' '); works just fine.

I came across the following example for ASP:

http://mrcmain.net/Smitha/RTE/examples/example.asp

Can someone help me to make it work with VB6?

Thanks in advance.

0
Comment
Question by:snarinsky
1 Comment
 
LVL 7

Accepted Solution

by:
bluV11t earned 500 total points
ID: 22838974
Hi!
I think you just have to do some small syntax changes to freeRTE_Preload function to make it VB.
<%

function freeRTE_Preload(content)

	' Strip whitespace.

	content = trim(content);

	' Strip newline characters.

	content = replace(content, chr(10), " ")

	content = replace(content, chr(13), " ")

	' Replace single quotes.

	content = replace(content, chr(145), chr(39))

	content = replace(content, chr(146), chr(39))

	' Return the result.

	freeRTE_Preload = content

End function

' Send the preloaded content to the function.

myVariable = freeRTE_Preload("<i>This is some <b>preloaded</b> content</i>")
 

%>

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now