這是我將圖像添加到帖子的方式。它顯示在所有的瀏覽器,但IE將圖像追加到富文本編輯器中,不能在IE中工作
<script type="text/javascript">
image = '<img src="http://forum.site.com/.../<?php echo $_SESSION['user_id']; ?>/question_reply_images/<?php echo $image_name; ?>" alt="<?php echo $alt; ?>" />';
document.getElementById('editor1').innerHTML += '<span style="width:100%; float:left;"' + image + '</span>';
window.location = '#reply_textbox';
</script>
這是這個過程:用戶在文本區域寫入文本(使用所見即所得的編輯器 - CKEDITOR),然後將選擇一個文件並上傳。然後將其附加到textarea的末尾。這甚至不會在IE中顯示。圖像正在上傳,但不會顯示在textarea中。
「editor1」到底是什麼? – Pointy 2012-04-06 19:44:58
將圖像附加到的textarea的ID。這是一個所見即所得的編輯器,例如CKeditor – Graham 2012-04-06 19:45:47