简体   繁体   中英

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

I'm trying to find the correct syntax for the Jquery link bellow(User reactivated) that redirect to a web page on a on Click.

I feel the syntax is incorrect and

So far I have this and it is incorrect.

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

my full function is as this

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];

you forgot closing the window.location.href try this

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

Just a simple typo.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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