Redirect to other page Intel XDK

不问归期 提交于 2019-12-11 21:03:21

问题


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

    });

回答1:


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



回答2:


This works for me:

activate_subpage("#sales"); 


来源:https://stackoverflow.com/questions/31062026/redirect-to-other-page-intel-xdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!