重定向到其他页面 Intel XDK

Redirect to other page Intel XDK

实际上我正在 Intel XDK IDE 上开发,但我需要重定向到其他页面。 谢谢

代码:

    $(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");
        }

    });

这个:

  window.location.href = "#sales";

不会工作,因为 href 需要 URL,而不是 CSS 选择器。

您需要有网络协议(http://https://),或类似这样的东西:

  window.location.href = "sales.html";

这对我有用:

activate_subpage("#sales");