我整个下午都在想办法解决这个问题,但已经放弃了,现在请聪明人帮忙:)
我有以下 Jquery/Javascript 函数,它在 Chrome 中运行良好 - 但在 IE 中没有任何反应?
$(".btnsubmitpost").click(function () {
var topicid = $(this).attr('rel');
var sbody = tinyMCE.get('txtPost').getContent();
$('.topicpostlistnewpost').remove();
$('.postsuccess').show();
$.post("/myurl/" + topicid + ".aspx",
{ "postcontent": sbody },
function (data) {
var returnUrl = $("value", data).text();
window.location.href = returnUrl;
return false;
});
return false;
});
我已经尝试了具有完整网址和绝对网址的 window.location、window.location.href,但 IE 就是不喜欢它?有任何想法吗?
该函数只是从帖子中获取一个 Url,并且应该将用户重定向到该 Url。但就像我说的,在 Chrome 中可以正常工作,只是在 IE 中不行(试过 IE8 和 IE9)