Switch accounts widget doesn't work Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Switch accounts widget doesn't work

    the_rocketeer
    the_rocketeer
    Forumember


    Other / Decline to state Posts : 88
    Reputation : 4
    Language : English
    Location : Europe

    Solved Switch accounts widget doesn't work

    Post by the_rocketeer May 10th 2017, 3:11 pm

    Hey guys!

    It's me, again
    I made switch accounts widget on my forum and it worked perfectly. Than I put it in my homepage message using <iframe> (because I want it there) and now it does nothing when i try to switch account. Do you have any idea why?

    These are my codes:

    Homepage message
    Code:
    <iframe style="width: 200px; height: 200px;" src="http://love-you-hogwarts.forumy.biz/h2-switch-account" scrolling="no" frameborder="0"> </iframe>

    Widget
    Code:
     
    <div id="accountswitch">
                         <script type="text/javascript">
            function switch_accounts() {
            jQuery.get(document.getElementById('logout').href, function() {
            jQuery.post('/login', 'login=1&username='+document.getElementById('switch_uname').value+'&password='+document.getElementById('switch_pass').value, function () {
            window.parent.location.reload();
            });
            });
            }
            </script>                 
       <div style="margin-top:20px">
                                     
          <center>
                         <span class="accountswitchtext">Switch account  </span>           
          </center>
                                                                                                 
          <div class="accountswitchhr">
                                      
          </div>
                                                                                                     
          <div class="accountswitchbg">
                           Username:<br />  <input id="switch_uname" type="text" /> <br /> <br />        Password:<br />  <input id="switch_pass" type="password" /> <br /> <br />                   
             <center>
                            <input type="button" value="Switch" onclick="switch_accounts();" />           
             </center>
                                                                                                        
          </div>
                                   
       </div>
                                
    </div>

    Thank you in advance for any help you can provide! Good
    SWS
    SWS
    Forumember


    Female Posts : 80
    Reputation : 7
    Language : US English / Dutch
    Location : 35 miles NWW of Los Angeles Airport (LAX) when able, currently living 1 mile SWW of Amsterdam Airport (AMS).

    Solved Re: Switch accounts widget doesn't work

    Post by SWS May 10th 2017, 3:13 pm

    Yeah, I got a hunch here. Because you're running it in an iframe, there's no connection to the FM DB, so that's why... unfortunately.
    the_rocketeer
    the_rocketeer
    Forumember


    Other / Decline to state Posts : 88
    Reputation : 4
    Language : English
    Location : Europe

    Solved Re: Switch accounts widget doesn't work

    Post by the_rocketeer May 10th 2017, 3:32 pm

    Hey SWS! bye

    Well, sounds pretty logical but If there's no connection to the FM how it's possible that recent topics work? I used the same way to move them there. Sorry for asking nonsenses, I'm really confused scratch
    SWS
    SWS
    Forumember


    Female Posts : 80
    Reputation : 7
    Language : US English / Dutch
    Location : 35 miles NWW of Los Angeles Airport (LAX) when able, currently living 1 mile SWW of Amsterdam Airport (AMS).

    Solved Re: Switch accounts widget doesn't work

    Post by SWS May 11th 2017, 10:17 pm

    An iframe is used to display a web page within a web page. Since the other widgets, like 'Recent Topics' are part of the main web page, they will work. It's a bit difficult for me to explain in brief, but that's most likely causing your iframe failing to act the way you want it to. That's my best guess anyway. The only reason I can come up with for anyone to use an iframe is to frame external sites, links and scripts on a site, like streaming media, weather updates, live maps, flight tracking, that sort of stuff.
    the_rocketeer
    the_rocketeer
    Forumember


    Other / Decline to state Posts : 88
    Reputation : 4
    Language : English
    Location : Europe

    Solved Re: Switch accounts widget doesn't work

    Post by the_rocketeer May 13th 2017, 4:49 am

    Ooookay, I tried to put the widget code in homepage message and it worked. The only thing left to do is set the position with css. cheers

    SWS, thanks a lot for your kind, detailed and informative answer!

    Problem and topic solved!

    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19432
    Reputation : 2010
    Language : fluent in dork / mumbojumbo & English haha

    Solved Re: Switch accounts widget doesn't work

    Post by Ape May 13th 2017, 3:19 pm

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules



    Switch accounts widget doesn't work Left1212Switch accounts widget doesn't work Center11Switch accounts widget doesn't work Right112
    Switch accounts widget doesn't work Ape_b110
    Switch accounts widget doesn't work Ape1010