Having issues with Navigation and BASE HREF....
The general structure of the site is
OUI/
index.php
js/
pages/
images/
So with that being said..on the index page I have a simple login form.
At this point the base URl for the page
- <base href="http://localhost/~me/OUI/">
When I click on the login button it calls..
- function doLogin(){
-
- $.ajax({
- type: "POST",
- url: "functions/checklogin.php",
- data: {
- usrnm: $('#username').val() , passwd: $('#password').val()
- }
- })
- .done(function( msg ) {
- if(msg.match(/YES/)){
- $('#username').val('');
- $('#password').val('');
-
- $("body").pagecontainer("change","pages/options.php",{ });
- }
- else
- {
- alert(msg);
- }
- });
- }
And it bring me to the options page of the application....all successful.
The base URL is now:
- <base href="http://localhost/~me/OUI/pages/options.php">
And again everyhting is working grand...can navigate all over the application etc etc.
here is where the problem happens.
On the options page...I have a signout button in the header.
- <div data-role="page" id="optionspage">
- <div data-role="header">
- <a href="#" onclick="doSignout();" data-role="button" data-mini="true" class="ui-btn-right" style="padding:5px">Sign Out</a>
- <h1>MAIN</h1>
- </div>
- <div data-role="content" id="options1">
- <? if($_SESSION['role']=='A'){?>
- <a href="admin.php" data-role="button" data-mini="true">ADMIN PAGE</a>
- <a href="ordersetup.php" data-role="button" data-mini="true">ORDER SETUP PAGE</a>
- <? } ?>
- <a href="production.php" data-role="button" data-mini="true">PRODUCTION</a>
- <a href="menurecipe.php" data-role="button" data-mini="true">MENU / RECIPE PAGE</a>
- </div><!-- /content -->
- </div>
It calls the function do Signout...
- function doSignout(){
- $.ajax({
- type: "POST",
- url: "../functions/signout.php",
- data: { }
- })
- .done(function( msg ) {
- alert('inhere');
- $('body').pagecontainer( "change", "../",{reload:true});
- });
- }
It does the signout however the new base URL is:
- <base href="http://localhost/~me/">
thus none of the scripts in the site now work since it shaved off the OUI part of the base URL.
Any ideas for this. I've been banging my head against this for a day.
Thanks
ROb