简体   繁体   中英

How to redirect to a local html page in phonegap iphone

My developing a hybrid app in coredova.My scenario is when user launches an application application will ask a login page. Once user submit the credentials i want to load a html page from my local ie from xcode. I tried different methods but it is not working.Some one adviced to try like this window.location="page2.html"; but when i give like this my server will not accept this,ie i want to submit the full path.

Here is my index.html

<html>
 <script src="cordova-2.7.0.js"></script> <script src="js/index.js"></script>
 <script language="javascript" type="text/jscript"> function DoLogin() { document.forms[0].action = "https://loginpage"; document.forms[0].submit(); } </script> <body > <formDraft

<html>
    <script src="cordova-2.7.0.js"></script>
    <script src="js/index.js"></script>
    <script language="javascript" type="text/jscript">
        function DoLogin() {
            document.forms[0].action = "https://loginpage";
            document.forms[0].submit();
        }
        </script>
    <body >
    <form method="post">
        <h2>
            Welcome ....
        </h2>
        <p>
        Please login using Agent or Employee Id
        </p>
        <p>
        <div>
            User Name:<input type="text" id="Ecom_User_Id" style="width: 100px" name="User_ID" /><br />
            Password:&x;&y;<input type="password" id="Password" style="width: 100px" name="Password"  /><br />
            <input type="submit" id="btnLogin" value="Login" onclick="javascipt:DoLogin();return false;" />
            <input name="target" type="hidden" id="target" value="file:///www/About.html"/>
            <input name="id" type="hidden" id="id" value="NLG" />
        </div>
        </p>
    </form>
</html>

i tried like this value = "About.html" but it is not possible,and also tried by giving the bundle path but not working.

Can anyone please help me with.Highly appriciated.

Thanks in advance.

try

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

instead of

window.location="page2.html"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM