You are not logged in.
#1 2005-05-23 17:18:58
script-tags disappear
I'm trying to insert a script-block with javascript in the source-code editor. When I put the script-block in the beginning of the source-code it disappears directly when I push the update-button.
Example (In the source-editor):
This code strips the script-tag
Code:
<script language="javascript" type="text/javascript">
<!--
function testFunction(){
alert('test');
}
//-->
</script>
<h1>Heading</h1>
<p>... some text ...</p>Output:
Code:
<h1>Heading</h1> <p>... some text ...</p>
While this code keeps the script-tags but changes it so all the code is on the same row
Code:
<h1>Heading</h1>
<p>... some text ...</p>
<script language="javascript" type="text/javascript">
<!--
function testFunction(){
alert('test');
}
//-->
</script>Output:
Code:
<h1>Heading</h1>
<p>... some text ...</p>
<script language="javascript" type="text/javascript"><!--function testFunction(){ alert('test');}//--></script>Is there any simple solution to this problem!?!
Offline
#2 2005-06-22 17:59:47
- pwa
- Member
- Registered: 2005-04-23
- Posts: 3
Re: script-tags disappear
I've got this probem to ![]()
Offline
#3 2005-06-22 20:17:18
- Demosthenes
- Member
- From: California
- Registered: 2005-05-22
- Posts: 48
- Website
Re: script-tags disappear
Code:
extended_valid_elements : "script[language|type]"
Target that explosion and fire
Offline
#4 2005-09-16 21:41:02
- storemike
- Member
- Registered: 2005-09-13
- Posts: 12
Re: script-tags disappear
I've got the same problem, even though script is in my list of extended valid elements:
extended_valid_elements : 'script[charset|defer|language|src|type],img[src|class|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|obj|param|embed],embed',
Any idea why my javascript is being stripped out?
Thanks,
Mike
Offline
#5 2005-09-19 17:33:42
- storemike
- Member
- Registered: 2005-09-13
- Posts: 12
Re: script-tags disappear
as a follow-up, the javascript is not stripped out in Firefox. IE removes it every time.
Offline
#6 2005-09-20 12:16:01
- happy_noodle_boy
- TWG Member
- Registered: 2005-02-24
- Posts: 171
Re: script-tags disappear
It seems that in IE, if the script is the first entry in the editor/HTML editor it gets stripped. Simply putting a break (<br />) or any other code before it prevents it from being stripped. Strange.
just because you're not paranoid, doesn't mean everybody isn't out to get you.
Offline
#7 2006-08-08 20:06:08
- progresv
- Member
- Registered: 2006-06-26
- Posts: 2
Re: script-tags disappear
Isn't there a better solution to this other than inserting a <br /> or some other text before the script block?
Offline
#8 2006-08-08 20:30:12
- pipkc
- Member
- Registered: 2006-08-05
- Posts: 10
Re: script-tags disappear
I had the sort of had the same problem. I was linking in my css but it was being stripped out. The way I got around that was just doing an include into another page with the script linked in etc.
Last edited by pipkc (2006-08-08 22:48:32)
Offline
#9 2008-02-15 11:45:36
- marko80
- Member
- Registered: 2008-02-14
- Posts: 1
Re: script-tags disappear
Hi all..i am going crazy:) i can copy/past <embed> tag in the htlm windows because it desappear if it is inside the <object> tag. It happen only with IE(6/7 vs.). How can i solve it?
Here's my code:
extended_valid_elements : "object[classid|codebase|height|width|id|align],param[name|wmode|value],embed[language|type|src|height|width|flashvars|quality|name|align|allowScriptAccess|pluginspage|autostart|loop|volume],a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
In Firefox it work properly:)
Ty all!
Last edited by marko80 (2008-02-15 12:59:11)
Offline
#11 2008-08-04 13:31:36
- AFAN
- Member
- Registered: 2008-08-04
- Posts: 1
Re: script-tags disappear
HI,
I still cant get the <script> tag to work - any pointers?
cheers
Offline
#12 2009-09-08 20:18:54
- av01d
- Member
- Registered: 2009-04-12
- Posts: 17
Re: script-tags disappear
Here is a patch for the problem that tinyMCE modifies/deletes code inside <script> tags:
https://sourceforge.net/tracker/index.p … tid=635682
Offline
#13 2009-09-09 13:32:17
- Felix Riesterer
- Administrator
- From: Germany
- Registered: 2005-12-30
- Posts: 4601
- Website
Re: script-tags disappear
av01d wrote:
Here is a patch for the problem that tinyMCE modifies code inside <script> tags
Here's what I think about such things - in case anyone bothers.
Offline
#14 2010-07-03 17:34:48
- ktwelsh
- Member
- Registered: 2008-05-03
- Posts: 3
Re: script-tags disappear
Are there plans to update the patch to work with the latest release (3.3.7 as of this post)? Any plans to fix this permanently? We are plagued by problems with TinyMCE modifying code inside script tags.
Offline
© 2003-2010