Redirect to other page Intel XDK

2019-09-06 06:23发布

actually I'm developing on Intel XDK IDE, but I need redirect to other page. Thanks.

Code:

    $(document).on("click", "#ini-sesion", function(evt)
    {

        var user = $("#user").val();
        var pass = $("#pass").val();

        if (user == "admin" && pass == "123"){
            intel.xdk.notification.alert( user + " - " + pass, "Data", "Ok");

                  window.location.href = "#sales";
        }else{
            intel.xdk.notification.alert( "Pass & User Incorrect", "Alert!", "Ok");
        }

    });

2条回答
做自己的国王
2楼-- · 2019-09-06 06:59

This:

  window.location.href = "#sales";

won't work, cause href needs an URL, not a CSS selector.

You need to have a web protocol (http:// or https://), or something like this:

  window.location.href = "sales.html";
查看更多
男人必须洒脱
3楼-- · 2019-09-06 07:04

This works for me:

activate_subpage("#sales"); 
查看更多
登录 后发表回答