解決ckeditor 錯誤 和一些WEB開發的錯誤

來源:互聯網
上載者:User

JavaScript 擷取 ckeditor 的值

var editor = CKEDITOR.replace('txtcontent');

editor.getData();

ckeditor 自動換行

word-break:break-all;

判斷瀏覽器是否支援JavaScript

<noscript>
<div style="color:red">您的瀏覽器不支援javascript,部分功能無法使用</div>
</noscript>

<div id="contents" style=" display:none"></div>

document.getElementById("contents").style.display = "block";

是否開啟cookie

var cookieEnabled = (navigator.cookieEnabled) ? true : false
if (!cookieEnabled) {

hiAlert("請開啟cookie", "注意");
window.location = "Default.aspx";
}

圖片太大

哈,這樣有人說容易,我在圖片上加上固定寬度,不加高度,這樣就不會破圖,也不會變形,
如:<img src="" width=600> 這樣,圖片會自動縮成寬為600的,而且高度也會跟著縮小
,是個比較好的方法,不過每次圖片都要處理,不好..下面介紹用CSS處理的方法:

#cont
{
margin-left:20px;
width:700px;
margin-bottom:10px;
line-height:30px;
}
#cont img {
max-width: 700px; width:expression(this.width > 700 ? "700px" : this.width)
}

#cont是內容層,#cont img 這個是限制如果圖片寬度超過700就按700顯示.這樣處理後,好了,
圖片問題暫時是解決了.

當然方法真的好多,只是看你自己如何處理哦

div 換行

設寬度 width,加一句 overflow: hidden;
中文會自動換行的
如果是連續的英文會讀成一個單詞不會換行,加以下代碼:
word-wrap: break-word; overflow: hidden;

////補充 關於本地上傳可以當道iis中就報錯啦。

原因是沒設定檔案的許可權。。。。。。。日哦

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.