xhEditor不能支持本地图片上传,请教?
xhEditor不能支持本地图片上传,只能用网络图片,急。。。。。。
xhEditor
--------------------编程问答--------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Editor.aspx.cs" Inherits="xhEditor在线编辑器.Editor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="Scripts/xhEditor/xheditor-1.2.1.min.js" type="text/javascript"></script>
<script src="Scripts/xhEditor/xheditor_lang/zh-cn.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
//初始化编辑器
$('#elem1').xheditor({ tools: 'full', width: '99.4%', height: '426px', forcePtag: false,
upBtnText: '上传', upMultiple: 1, upLinkUrl: 'upload.aspx',
upImgUrl: 'upload.aspx', upImgExt: 'jpg,jpeg,gif,png',
upFlashUrl: 'upload.aspx', upFlashExt: 'swf',
upMediaUrl: 'upload.aspx', upMediaExt: 'wmv,avi,wma,mp3,mid'
});
});
//存值
function setValue() {
$.ajax({
cache: false,
url: "upload.ashx",
data: { "text": $("#elem1").val() },
success: function (e) {
//alert("success");
window.location.href = "Success.aspx";
}
});
}
//取值
function getText() {
$.ajax({
cache: false,
url: "getValue.ashx",
success: function (e) {
//alert(e);
$("#getDIV").append(e);
}
});
}
</script>
</head>
<body>
<form id="form1" method="POST">
<div id="editorDIV" style="width: 900px">
<hr />
<br />
<textarea id="elem1" name="content" >test</textarea>
<br />
<hr />
<input type="button" value="提交" onclick="setValue()" />
<input type="reset" name="reset" value="重置" />
<input type="button" onclick="getText()" value="取值"/>
</div>
<hr/>
<div id = "getDIV">
</div>
</form>
</body>
</html>
<%--使用指南http://xheditor.com/manual/1--%>
试试
补充:Java , Web 开发