The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Switch accounts widget doesn't work

View previous topic View next topic Go down

Solved Switch accounts widget doesn't work

Post by the_rocketeer on May 10th 2017, 5: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
avatar
the_rocketeer
Forumember

Female Posts : 36
Reputation : 1
Language : Bulgarian, English
Location : Europe

http://love-you-hogwarts.forumy.biz/

Back to top Go down

Solved Re: Switch accounts widget doesn't work

Post by SWS on May 10th 2017, 5: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.
avatar
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).

http://www.friendcodes.nl

Back to top Go down

Solved Re: Switch accounts widget doesn't work

Post by the_rocketeer on May 10th 2017, 5: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
avatar
the_rocketeer
Forumember

Female Posts : 36
Reputation : 1
Language : Bulgarian, English
Location : Europe

http://love-you-hogwarts.forumy.biz/

Back to top Go down

Solved Re: Switch accounts widget doesn't work

Post by SWS on May 12th 2017, 12:17 am

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.
avatar
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).

http://www.friendcodes.nl

Back to top Go down

Solved Re: Switch accounts widget doesn't work

Post by the_rocketeer on May 13th 2017, 6: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!

avatar
the_rocketeer
Forumember

Female Posts : 36
Reputation : 1
Language : Bulgarian, English
Location : Europe

http://love-you-hogwarts.forumy.biz/

Back to top Go down

Solved Re: Switch accounts widget doesn't work

Post by APE on May 13th 2017, 5:19 pm

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



avatar
APE
Manager
Manager

Male Posts : 10662
Reputation : 996
Language : fluent in dork / mumbojumbo & English haha
Location : STUCK IN FORUMOTIONS SERVERS HELP ME !!!!!!

http://chatworld.forumotion.co.uk/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum