Switch accounts widget doesn't work
3 posters
Page 1 of 1
Switch accounts widget doesn't work
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
Widget
Thank you in advance for any help you can provide!
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!
Re: Switch accounts widget doesn't work
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.
Re: Switch accounts widget doesn't work
Hey SWS!
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
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
Re: Switch accounts widget doesn't work
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.
Re: Switch accounts widget doesn't work
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.
SWS, thanks a lot for your kind, detailed and informative answer!
Problem and topic solved!
SWS, thanks a lot for your kind, detailed and informative answer!
Problem and topic solved!
Re: Switch accounts widget doesn't work
Problem solved & topic archived.
|
Similar topics
» Switch Accounts Widget
» Switch Accounts issues
» Switch Accounts isn't working
» Tuesday tip : Reputation system: only allow positive votes
» FMChat - auto login doesnt work
» Switch Accounts issues
» Switch Accounts isn't working
» Tuesday tip : Reputation system: only allow positive votes
» FMChat - auto login doesnt work
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum