1

Could not find a better title but will explain my problem here. I have a jquery mobile app with a login page. After logging in an API call determines which databaseversion the user/customer has. Since all logic is going by API calls to the user/customer database. So after logging in there basically is a need for a different js codebase. In other words a different html head is needed e.g:

Login page

<head><script src="app/scripts/version_all.js"></script></head>

After login

<head><script src="app/scripts/Versions/version1_1.js"></script></head>

My jqm has multipage template setup. Can anybody give some pointers to solve this in an elegant way? Should I work for example with page refresh or should I inject code ?


Okay, I cheered to early. This is the important part of my index.php

<?php if (!empty($_REQUEST['dbversion'])){ ?>
 <script src="app/scripts/Versions/combined<?php echo $_POST['dbversion'];>.js"></script>   
<?php } else { ?>
 <script src="app/scripts/Versions/combined.js"></script>   
<?php } ?>    

And here is my page redirect:

$.mobile.changePage('#loginpage',{
         type: "get",
         data: {dbversion:"DB11"}
    }
    );

Since #loginpage is not a url the data argument is not picked up. When I change it to

$.mobile.changePage('index.php#loginpage',{
         type: "get",
         data: {dbversion:"DB11"}
    }
    );

I get a blank page because #loginpage is not picked up

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Bart
  • 91
  • 3
  • 11

0 Answers0