我想实现将adsense代码存储到sql数据库的功能。为此,我在文本框上使用了ajax:HtmlEditorExtender
。现在我打字这个代码如何从文本框中获取javascript/html代码
<script type="text/javascript"><!-- google_ad_client = "ca-pub-*****"; /* 728x90, created 6/12/02 */ google_ad_slot = "****"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead.googlesyndicaon.com/pead/show_ad.js"> </script>
现在当代码被插入到数据库中,上述代码被如下转换的问题是。
<pre><<span>script</span> <span>type</span>="<a>text/javascript</a>"><!--
<span></span>google_ad_client = "ca-pub-*****";
<span></span>/* 728x90, created 6/12/02 */
<span></span>google_ad_slot = "****";
<span></span>google_ad_width = 728;
<span></span>google_ad_height = 90;
<span></span>//-->
<span></span></<span>script</span>>
<span></span><<span>script</span> <span>type</span>="<a>text/javascript</a>"
<span></span><span>src</span>="<a href="view-source:http://pagead.googlesyndicaon.com/pead/show_ad.js">
http://pagead.googlesyndicaon.com/pead/show_ad.js</a>">
<span></span></<span>script</span>></pre>
请帮我:
- 我应该做的,这样我可以存储上的代码,因为它是数据库。
- 当代码正确存储到数据库中,这是控制最适合显示广告。(我的意思是我想告诉另一页上的广告。)
在此先感谢。
你在使用洗手液吗?只要确定。为什么不使用ckeditor? –
@PaulZahra:使用EnableSanitization =“true”可以解决我的第一个问题。非常感谢。我应该为我的第二个问题做些什么。 –
@PaulZahra对不起我的错误。使用EnableSanitization =“true”并没有什么区别。这也是围绕这样的每个文本。 脚本 –