November Happy Hour will be moved to Thursday December 5th.

JavaScript in XHTML String disappears

Vote:
 

I have a client who is using an email campaign manager which uses JavaScript to generate forms. The client needs to put these forms on various pages in the CMS.

The first time the script is put into an XHTML property and the page is published everything works. However, when you go in to edit the page again, the JavaScript is gone.

The JavaScript looks like this: 

<script language="JavaScript" type="text/javascript" charset="utf-8"src="http://promoter.melbourneit.com.au/em/forms/subscribe.php?db=111&amp;s=111&amp;u=1118&amp;k=d1111&amp;emb=1"></script>

The website is running on EPiServer 4.61.

Any help to get this working would be greatly appreciated. 

 

#28700
Mar 18, 2009 18:28
Vote:
 

Have you tried to put add a separate longstring for the javascript and disabled all the options for it in admin mode (giving you a simple textarea)?

You'll of coursehave to add a episerver:property or some such in your templates to display the new field too.

#28712
Mar 19, 2009 13:53
Vote:
 

Hi

I have solved this problem by putting a <span> tag and a nbsp around the script taggs.

<span style="DISPLAY: none">&nbsp;</span><script type="text/javascript">callafunction("hallo");</script> 

This will keep the script from beeing deleted by the adminGUI and display functional HTML without disturb the layout.

/Janne 

 

#28713
Mar 19, 2009 14:02
Vote:
 

It will be removed by IE if the <script> tag is the first element in the editor.

 

#28714
Mar 19, 2009 14:10
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.