How can i prevent RTE from changing my Javascript Options
thahammer
Posted: Wednesday, March 05, 2008 2:18:56 PM

Rank: Aficionado

Joined: 8/28/2007
Posts: 127
Location: Bavaria
Is this possible?

It seems that the RTE accept my new Javascript for Spam Protection. But he added some Stuff to my code.

Code:


<SCRIPT type=text/javascript>
/ / < ! [CDATA[
emailE = ('mail' + '@' + 'domain' + '.de');document.write('<a href="mailto:' + emailE + '">' + emailE + '<\/a>');
/ / ] ] >
</SCRIPT>


Now i get an Server Error cause of / / < ! [CDATA[

Code:

Cannot have '] ] >' inside an XML CDATA block.


So how can i prevent RTE from changing my code?
Or how can i write the Code to prevent the Error on the Server?

I Love umbraco
SoerenS
Posted: Wednesday, March 05, 2008 2:52:11 PM

Rank: Fanatic

Joined: 7/25/2006
Posts: 392
Location: Silkeborg, Denmark
I've made a macro called "Custom HTML", which takes "Multiple Textlines" as a parameter. The XSLT macro itself takes the parameter and outputs it without output-escaping.

This allows you to insert custom HTML or javascript in a document inside the WYSIWYG editor without it messing around with your code.

Simple, but effective. Also usefull for when you want to embed a YouTube video.

/SoerenS

Brug for råd til hvordan du driver en god webshop? / Need advice on how to run an effective webshop?
thahammer
Posted: Wednesday, March 05, 2008 2:56:16 PM

Rank: Aficionado

Joined: 8/28/2007
Posts: 127
Location: Bavaria
Soeren Sprogoe wrote:

I've made a macro called "Custom HTML", which takes "Multiple Textlines" as a parameter. The XSLT macro itself takes the parameter and outputs it without output-escaping.

This allows you to insert custom HTML or javascript in a document inside the WYSIWYG editor without it messing around with your code.

Simple, but effective. Also usefull for when you want to embed a YouTube video.

/SoerenS


This sounds coll! But right now i have no idea how to make this?
I found another way for my Javascript. It is not so nice, but it´s working!

Code:

<A href="javascript:nospam('name')">Mail</A>


And i made an Function for the Javascript.

Code:

function nospam(mail)
{
  var domain = "synthax";
  var country = ".de";
  emailE = (mail + '@' + domain + country);
  window.location.href = "mailto:" +   emailE;
}


So i call the Script over the function, and at the End of the function the window.location.href with mailto opens the E-Mail Window!
Not so beatiful but it´s working. :D

I Love umbraco
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.