TinyMCE字段中的脚本标记未正确保存 [英] Script tags in TinyMCE fields are not saving correctly
问题描述
我在我的网站上运行tinyMCE,并试图插入脚本标记。我正在尝试将我的脚本标记插入到tinyMCE实例源的主体中。
然而,当我遇到问题时,当我提交包含tinyMCE元素的表单时,它将剥离标签。
我尝试了以下几行,但仍然没有成功。
-
allow_script_urls:true
-
valid_elements:'* [*]'
-
extended_valid_elements:'script [language | type]'
$ b有一点我注意到,但是如果我必须将脚本代码发布到源代码部分tinymce实例和它的工作原理。但是,我需要能够将它添加到tinymce实例的
< body>
中,以便我可以看到它的预览等。
以下是我正尝试上传的脚本标记。
< script type =text / javascriptsrc =http://resources.32red.com/ad.aspx ?PID = 237638&安培;出价= 3344\" >< /脚本>
任何人都可以对此有所了解吗?
谢谢
解决方案请尝试以下操作:
extended_valid_elements:'script [language | type | src]'
我发现你已经尝试使用
脚本更新
,但你忘记了允许脚本标记的src属性extended_valid_elements
language | type]'
所以现在
src
属性被剥离出来。I am running tinyMCE on my site and I'm trying to insert script tags. I am trying to insert my script tags into the body of the source of the tinyMCE instance.
However, when I do I get problems. When I submit the form including the tinyMCE element It strips the tags.
I have tried the following lines below with still no success.
allow_script_urls: true
valid_elements : '*[*]'
extended_valid_elements: 'script[language|type]'
One thing I have noticed though that if I have to post the script code to the section of the source code of the tinymce instance and it works. However, I need to be able to add it to the
<body>
of the tinymce instance so I can see previews etc of it.Below is the script tag I'm trying to upload.
<script type="text/javascript" src="http://resources.32red.com/ad.aspx?pid=237638&bid=3344"></script>
Can anyone shed any light on this?
Thanks
解决方案Try the following:
extended_valid_elements: 'script[language|type|src]'
I see that you've already tried updating the
extended_valid_elements
property using'script[language|type]'
but you forgot to allow the src attribute for the script tagsso right now the
src
attribute is being stripped out.这篇关于TinyMCE字段中的脚本标记未正确保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!