我正在开发一个项目,其中我有像 facebook 这样的 Stream Posting,用户也可以发布任何网站的链接,我想像 facebook 一样实现它,即当用户发布链接时,它会在文本框下方显示网站预览,我不知道我怎么能做到这一点 我怎样才能实现这个功能,我正在使用 Ajax 调用在流上发布
$.ajax({
url: "My Controller ActionResult",
type: "POST",
data: JSON.stringify({ objResourceModel: objResource, objTagList: TagTypeList, sendEmail: $("#chkbxSendEmail")[0].checked, groupId: ResourceVariable.GroupId, isblog: isblog, isquest: isquest }),
dataType: "html",
contentType: "application/json; charset-utf-8",
beforeSend: function () {
$("#btnPost").attr("disabled", "disabled");
loading = setTimeout("$('#load').show()", 200);
},
complete: function () {
clearTimeout(loading);
$("#load").hide();
$("#btnPost").removeAttr("disabled");
},
success: function (Result) {
if (Result == "false") {
alert("Video must be of Youtube or vimeo");
}
else {
$('#divResourceDetails').html(Result);
ClearPostSectionData(); //function call
SetUpCommentSectionEvent(); //function call set up events
GetLatestAnnouncements();
$('#tagOutput').html("");
outputTagHtml = '';
TagTypeList = [];
//GetBrowseByInstructor(); //function call
//GetBrowseByTagType(); //function call
GetBrowseByResource(); //function call
GetBrowseByMonth(); //function call
}
},
error: function (msg) {
alert("Unable to save uploaded post details: " + msg.responseText);
}
});