繁体   English   中英

在 onClick="window.location.href" 上使用 jQuery 重定向到 asp 页面

[英]Redirect to asp page using jQuery on a onClick="window.location.href"

我正在尝试找到 Jquery 链接波纹管(用户重新激活)的正确语法,该链接重定向到点击上的 web 页面。

我觉得语法不正确并且

到目前为止,我有这个,这是不正确的。

jQuery("#status_text").html('User reactivated.<a href = "#" 
onclick="window.location.href='deactivationreason.aspx ? +$.param(studentid)> Deactivate</a>'");

我完整的 function 就是这样

jQuery.ajax({
        type: 'POST',
url: '<%= thisUser.AppendIDToURL("/lms/admin/ajax-reactivatestudent.aspx") %>&rand=' + '<%= 
DateTime.Now.Millisecond.ToString()  %>',
                    data: '<%= studentHash %>',
                    async: true,
                    success: function (data, textStatus, jqXHR) {
                        var response = data || 'no response text';
                        var r = response.split('||');
                        var studentid = r[0];

你忘了关闭 window.location.href 试试这个

    jQuery("#status_text")
    .html('User reactivated.<a href = "#" 
    onclick="window.location.href=\"deactivationreason.aspx ? +$.param(studentid)\"> Deactivate</a>');

只是一个简单的错字。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM