0

I have an Index.Html and UI/Main.html files. Index html PageInit event I want to locate the page to main.html. Here is the javascript below.

$(document).bind("pageinit", function () {
            debugger;
            if (localStorage.getItem("user") != null) {

                $.mobile.changePage("UI/Main.html", {
                    transition: "slideup",
                    reverse: false,
                    changeHash: false
                });

            }
        });

This script redirects the page , but when I look into chrome console it gives me 404 error

../Site/UI/UI/Main.html but I want it to redirect ../Site/UI/Main.html

Why it add double UI? Any Ideas

Also in the Index.html a href element working good.

<a href="UI/Main.html" id="myhref" data-theme="reset" data-ajax="false" class="mobilizmred" data-role="button" data-ajax="false">Sign in</a>  
4

1 に答える 1

0

それらが同じ場所にないことは確かですか? コンソールに従って、不要な行を削除してください。試してみてください

$.mobile.changePage("Main.html", {
   transition: "slideup",
   reverse: false,
   changeHash: false
});
于 2013-09-17T13:46:54.317 に答える