2013-07-22 38 views
0

我是CKEditor的新手,我在剪貼板上粘貼屏幕截圖併成功保存到數據庫中。但是,當我想用​​Ajax和JSON格式結果重新設置在編輯器中的值進行檢索,屏幕顯示圖像不顯示在編輯器,但它有,當我把它放在警報()的值。CKEditor無法解碼保存後自身生成的JSON圖像值

從JSON結果下面的值,它是不能被CKEditor的

<p> < IMG ALT = " " SRC = "的數據進行解碼:圖像/ PNG; BASE64,iVBORw0KGgoAAAANSUhEUgAAAQYAAACHCAIAAAB7zGCiAAADR0lEQVR4nO3ZMU5jSRhG0d5T74bFeC1eBblXwhbISBAzyWBDg74OsAeke05kP7 SXvDfUtn 9Q8xLy8vz8/PT09Pj4 P9/F33/04P86v734A /米S2CSRI4lNEjmS2CSRI4lNEjmS2CSRI4lNEjmS2CSR8wOSOB1 3x0fvmv5X0giRxKbJHIksUki58pJnA6/zw6nDxffzO754uFwmekvLr8BSeRcNYnT4TzJp8PrBJ/ETFX/Ly93Phzv3tz5leU3IYmcmx2czvP7ZtA/fvjhzZWWX40kcq6cxMPx7nL0OU/q5ehz2do/nekvLr8BSeRcM4l3o/rZpJ53/E 3 S8uvw1J5FwziT C3wc9MsNn30Z OLy25BEzlUPTpdzz93xdLx7N乙// mT0eu/d8fi6zX9x U1IIucH/C/xo0kiRxKbJHIk sUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksUkiRxKbJHIksf0L2hcpkn2UQEoAAAAASUVORK5CYII = "/> </P >

林使用把值在文本編輯器以下代碼

CKEDITOR.instances.editor1.setData(json.result); 

如何解碼ckeditor中的編碼圖像?任何解決方案在此先感謝

回答

1

這是一個base64編碼的圖像,它不涉及到JSON。 也許你的代碼的某些部分是打破它的一部分,這就是爲什麼它不能正確顯示再次,但而不是使用base64編碼的圖像,你應該將它們上傳到服務器。

您可以使用this plugin(版本1.0是免費的,只是執​​行此任務)來照顧轉換