JQuery Mobile Caching issues, onClick not fired unless page is reloaded -


OK, tell me first I'm assuming it's related to caching. But I'm not 100% sure

I'm working on a mobile site that you can see

The problem is logging out, the logout button is fine Clicking right from

If the user logs in, navigates to any page on the site, then tries to click the logout (see the function below) they will not receive anything, no posts, no transfers , And if I keep a warning in the function then it's not done. Nothing. Before leaving the user to reload the page and log out efforts.

function submitLogout () {$ .post (".. / server / log.php", {uaction: "logout"}, function (data) {window.location = "/ index .php ";});
  • Username Foo , password bar
  • .
  • Click on logout

    Now if you want to see the function call, then reload the page and click on logout.

    Or, instead of navigating to step 4, logout

    ** then to clarify **; SubmitLogout function never actually runs; If I change the function

      function submitLogout () {alert ("wtf"); $ .post (".. / server / log.php", {uaction: "logout"}, function (data) {window.location = "/index.php";}); }   

    Warning is never called. If there is a problem with the relative path, then I do not know. The post is never called. I added breakpoint to the function and I can confirm that it has never been entered.

    You use your relative to your log. With Php : "..//server/log.php"

    You can count on the relative path, but always think what will be referenced. In this situation, this is the current URL, the location of the client-side, the path to the JS file is not.

    In your case, with .. part / bin , which is the folder in which your endpoint is located.

    Here's the full solution: submit the functionlogout (warning {warnings ('submitLogout is triggered'); $ .post ("/ bin / server / log.php", {uaction: "logout"}, function (data) {window.location = "/index.php";}); }

  • Comments

    Popular posts from this blog

    mysql - BLOB/TEXT column 'value' used in key specification without a key length -

    c# - Using Vici cool Storage with monodroid -

    python - referencing a variable in another function? -