1.下載SinaEditor 2.JSP呼叫頁 複製程式碼 程式碼如下: 程式碼如下: 其中,src="/edit/editor.htm表示下載的SinaEditor中的editor.htm檔案路徑;帶綠色的兩處ID須一致 3.下載的editor下包含有img.htm和attach.htm,其中第一個為上傳圖片的,第二個是上傳附件的,當然兩個是一樣的使用方法,都可看做上傳文件的。 4.以下是img.htm中上傳圖片的範例。做記載方便下次使用。 複製程式碼 程式碼如下:function chk_imgpath ( 'radio1').checked==true){ if($("imgpath").value == "http://" || $("imgpath").value == "") { window.close(); return; } LoadIMG($("imgpath").value); == "") { alert("請選擇上傳圖片檔案!"); return; > var filetype = filepath.substring(filepath.lastIndexOf('.')); var regu = ".gif.jpg.png.jpge.GIF.JPG.P .indexOf(filetype) == -1) { alert('只允許上傳.gif.jpg.png.jpge 類型檔案!'); j.ajaxFileUpload({ type : 'POST', url : '/ask/fileUpload ?type=img', dataType: 'String', #imgpath").attr("value",data); j( "#radio1").attr("checked","true"); .style.display=''; }, : function(data){ alert('使用中失敗); } }5.後台程式碼編寫(不做敘述)