Prevent reloading page in DOM on changePage...

Prevent reloading page in DOM on changePage...

Hi,

I am making a web application using jQuery Mobile. There is a two steps login process. Both steps are on a different pages. If information provided on both the steps are valid then only he will be redirected to other site pages else he will be redirected to first page and error message is displayed.

The issue is when user transits from second page to first page, div with data-role="page" is loaded twice in DOM  but not the page level Javascript. The Javascript file is included in the same div only.

How can I prevent the First page to be reloaded once again in DOM? Or how can I reload the Javascript with the page?