Redirect to other page Intel XDK

1.8k views Asked by At

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

There are 2 answers

0
Francisco Corrales Morales On BEST ANSWER

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";
0
iexecute On

This works for me:

activate_subpage("#sales");