簡體   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