Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Url TideSDK不更改主窗口页面_Url_Tidesdk - Fatal编程技术网

Url TideSDK不更改主窗口页面

Url TideSDK不更改主窗口页面,url,tidesdk,Url,Tidesdk,我正在尝试制作一个带有登录表单index.html和迷你控制面板panel.html的应用程序,但是当我尝试登录时,该应用程序只显示Notificaction,而不重定向到panel.html页面 这是my index.html的代码 <script type="text/javascript"> function loginTrue() { Ti.UI.currentWindow.setURL("app://panel.html"

我正在尝试制作一个带有登录表单index.html和迷你控制面板panel.html的应用程序,但是当我尝试登录时,该应用程序只显示Notificaction,而不重定向到panel.html页面

这是my index.html的代码

    <script type="text/javascript">
    function loginTrue() {
                  Ti.UI.currentWindow.setURL("app://panel.html");
    }
    function showNotify(title, message) {
                  var notification = Ti.Notification.createNotification({
                    'title': title || 'Sin Titulo',
                    'message': message || 'Sin mensaje',
                    'timeout': 10
                  });
                  notification.show();
                }
        </script>
        <script type="text/javascript">

        </script>
        <script type="text/python">
            import MySQLdb
            import os
            db = MySQLdb.connect(host="localhost",user="root", passwd="toor", db="db")
            cursor = db.cursor()
            def login():
                username= document.getElementById('usuario').value;
                passw= document.getElementById('contrasena').value;
                cursor.execute("SELECT * FROM usuarios WHERE userlUsuario='"+username+"' and userContrasena='"+passw+"'" )
                res = cursor.fetchone()
                if(res==None):
                    showNotify("Error!", "Datos Invalidos, intente de nuevo.");
                else:
                    showNotify("Acceso!", "Login Correcto!");
                    loginTrue();

        </script>
<!DOCTYPE html>
<head>
    <link rel="stylesheet" href="css/style.css" media="all" />
</head>
<body class="login">
    <div class="login">
        <section id="login">
            <h1><strong>Login</strong></h1>
            <form method="link">
                <input id="usuario" type="text" placeholder="Usuario" />
                <input id="contrasena" type="password" placeholder="Contraseña" />
                <button class="blue" onclick="login()">Entrar</button>
            </form>
        </section>
    </div>
</body>
</html>

我发现了它,问题是当有人点击提交按钮时,登录表单将页面重定向到它自己,我通过添加javascript:void0解决了它;作为形式的作用

<form action="javascript:void(0);">