How can I prevent the default behavior on internal linked pages?
My goal is to prevent the user from accessing page contents without first authenticate.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Recently I was facing the same situation. I was using jQuery Mobile along with jQuery Templates, all sensitive data coming from a web service.
My solution was to register a callback with the
pagebeforeshowevent for any page that the user needs authorization for. Within this callback function, I checked if the user is authorized, in my case this is a JSONP web service call, which either returns the data, or an appropriate error code.Then, if the user is authorized, the data is rendered with jQuery Templates; otherwise I redirect the user to a login page, using
$.mobile.changePage().