Am having a problem with my JavaScript log out codeHow do JavaScript closures work?What is the most efficient way to deep clone an object in JavaScript?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?“Thinking in AngularJS” if I have a jQuery background?

As easy as Three, Two, One... How fast can you go from Five to Four?

How do we say "within a kilometer radius spherically"?

ASCII Meme Arrow Generator

Is Dumbledore a human lie detector?

How to befriend someone who doesn't like to talk?

Transfer custom ringtones to iPhone using a computer running Linux

What's the meaning of the expression "short circuit" in the text bellow?

Can the removal of a duty-free sales trolley result in a measurable reduction in emissions?

Command of files and size

Difference templates and layouts

Housemarks (superimposed & combined letters, heraldry)

bash vs. zsh: What are the practical differences?

Increase speed altering column on large table to NON NULL

Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?

noalign caused by multirow and colors

Flat with smooth fibers implies formally smooth?

What is the reason for setting flaps 1 on the ground at high temperatures?

Why is Na5 not played in this line of the French Defense, Advance Variation?

So a part of my house disappeared... But not because of a chunk resetting

Rail-to-rail op-amp only reaches 90% of VCC, works sometimes, not everytime

Does a (nice) centerless group always have a centerless profinite completion?

What STL algorithm can determine if exactly one item in a container satisfies a predicate?

How durable are silver inlays on a blade?

Are polynomials with the same roots identical?



Am having a problem with my JavaScript log out code


How do JavaScript closures work?What is the most efficient way to deep clone an object in JavaScript?How do I remove a property from a JavaScript object?Which equals operator (== vs ===) should be used in JavaScript comparisons?How do I include a JavaScript file in another JavaScript file?What does “use strict” do in JavaScript, and what is the reasoning behind it?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?“Thinking in AngularJS” if I have a jQuery background?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-3















I am trying to logout a user using a JavaScript code but it keeps loading without logging out.What have I done wrong?



I have tried changing the function itself but it still wouldn't log out.The loader just keeps on running.



this is the code


logout.html(loader);
$.get("modules/"+role+"/"+role+".php",
,function(pagedata)
logout.show().html(pagedata);
);


I'm expecting the code to logout and take me back to the login page.










share|improve this question




























    -3















    I am trying to logout a user using a JavaScript code but it keeps loading without logging out.What have I done wrong?



    I have tried changing the function itself but it still wouldn't log out.The loader just keeps on running.



    this is the code


    logout.html(loader);
    $.get("modules/"+role+"/"+role+".php",
    ,function(pagedata)
    logout.show().html(pagedata);
    );


    I'm expecting the code to logout and take me back to the login page.










    share|improve this question
























      -3












      -3








      -3


      1






      I am trying to logout a user using a JavaScript code but it keeps loading without logging out.What have I done wrong?



      I have tried changing the function itself but it still wouldn't log out.The loader just keeps on running.



      this is the code


      logout.html(loader);
      $.get("modules/"+role+"/"+role+".php",
      ,function(pagedata)
      logout.show().html(pagedata);
      );


      I'm expecting the code to logout and take me back to the login page.










      share|improve this question














      I am trying to logout a user using a JavaScript code but it keeps loading without logging out.What have I done wrong?



      I have tried changing the function itself but it still wouldn't log out.The loader just keeps on running.



      this is the code


      logout.html(loader);
      $.get("modules/"+role+"/"+role+".php",
      ,function(pagedata)
      logout.show().html(pagedata);
      );


      I'm expecting the code to logout and take me back to the login page.







      javascript






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 21:57









      Moses WayodiMoses Wayodi

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          0














          The



          $.get()


          method requests data from the server with an HTTP GET request.
          The required URL parameter specifies the URL you wish to request.
          The optional callback parameter is the name of a function to be executed if the request succeeds.



          $.get(URL,callback);


          so change your code :



           logout.html(loader);
          $.get("modules/"+role+"/"+role+".php",function(pagedata)
          logout.show().html(pagedata);
          );





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328963%2fam-having-a-problem-with-my-javascript-log-out-code%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            The



            $.get()


            method requests data from the server with an HTTP GET request.
            The required URL parameter specifies the URL you wish to request.
            The optional callback parameter is the name of a function to be executed if the request succeeds.



            $.get(URL,callback);


            so change your code :



             logout.html(loader);
            $.get("modules/"+role+"/"+role+".php",function(pagedata)
            logout.show().html(pagedata);
            );





            share|improve this answer



























              0














              The



              $.get()


              method requests data from the server with an HTTP GET request.
              The required URL parameter specifies the URL you wish to request.
              The optional callback parameter is the name of a function to be executed if the request succeeds.



              $.get(URL,callback);


              so change your code :



               logout.html(loader);
              $.get("modules/"+role+"/"+role+".php",function(pagedata)
              logout.show().html(pagedata);
              );





              share|improve this answer

























                0












                0








                0







                The



                $.get()


                method requests data from the server with an HTTP GET request.
                The required URL parameter specifies the URL you wish to request.
                The optional callback parameter is the name of a function to be executed if the request succeeds.



                $.get(URL,callback);


                so change your code :



                 logout.html(loader);
                $.get("modules/"+role+"/"+role+".php",function(pagedata)
                logout.show().html(pagedata);
                );





                share|improve this answer













                The



                $.get()


                method requests data from the server with an HTTP GET request.
                The required URL parameter specifies the URL you wish to request.
                The optional callback parameter is the name of a function to be executed if the request succeeds.



                $.get(URL,callback);


                so change your code :



                 logout.html(loader);
                $.get("modules/"+role+"/"+role+".php",function(pagedata)
                logout.show().html(pagedata);
                );






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 24 at 22:14









                Razmik GhookasRazmik Ghookas

                854




                854





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55328963%2fam-having-a-problem-with-my-javascript-log-out-code%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript