I am using $.mobile.changePage()
to change move from a login page to a home page. From there, none 开发者_如何转开发of the links on the home page work. Those links are all using the standard href link. I tried just using an href=""
link for the login button as well and that works but the problem is, once the login button is clicked, I need to do some sort of login process to make sure that they entered in the right stuff and as far as I know, the href just happens immediately and I cannot make it wait or stop all together. I tried using the event.preventDefault()
but that would not stop the href from switching the page before the login checking was done. Anyone have any ideas on how to solve my situation? I am pretty new to jQuery Mobile so I dont fully understand every detail about it yet. Also I am working with some legacy code at the moment and that code uses jQuery mobile alpha 4.1.
How are you checking for the data from the login page? If you are only using javascript, you could just add an onClick()
handler on the login button, and get the values from the fields with document.getElementByID()
. AFTER that you could do $.mobile.changePage()
.
Or maybe I don't understand what you are trying to do.
精彩评论