我想實現將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」並沒有什麼區別。這也是圍繞這樣的每個文本。 腳本 –