Optimize my JavaScript
3 posters
Page 1 of 1
Optimize my JavaScript
Technical Details
Forum version : #phpBB3
Position : Founder
Concerned browser(s) : Google Chrome
Who the problem concerns : All members
When the problem appeared : In a HTML page
Forum link : ( link is hidden, you must reply to see )
Description of problem
I have a problem with my forum's JavaScript. When I refresh the page the forum takes one or two seconds charging the code.I mean, for example, I have this code:
- Code:
$(function(){
if(_userdata["session_logged_in"] == 0){
$('#natthome:contains(Home)').remove();
}
else {
$('div#menuWrapper li:contains(Registrarse)').remove();
}
});
This code removes a word from the navbar for the connected members. Only no-register members can see that word. But... when I am log in and i refresh the forum I see that word, one second, and then the JavaScript works and remove it.
I would like to know if there is any way of optimizing my JavaScript to avoid that annoying second.
¡Thanks!
Re: Optimize my JavaScript
Hello,
So you want that word "Home" not to appear for that split second right?
So you want that word "Home" not to appear for that split second right?
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Optimize my JavaScript
Hello,
I suggest you revert your codes. Meaning, you should hide the Home button for everyone, and only show it to the guests. Therefore when you're logged in you won't see that button at all.
Regards,
TC.
I suggest you revert your codes. Meaning, you should hide the Home button for everyone, and only show it to the guests. Therefore when you're logged in you won't see that button at all.
Regards,
TC.
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Optimize my JavaScript
Hello! Well, but this doesn't solve my problem. I have other codes and I want to split that second in all mi JavaScriptTheCrow wrote:Hello,
I suggest you revert your codes. Meaning, you should hide the Home button for everyone, and only show it to the guests. Therefore when you're logged in you won't see that button at all.
Regards,
TC.
Re: Optimize my JavaScript
@Leiva, that split second is for the javascripts to load. Have you considered adding a loading page to your forum so the javascripts will work and then show the forum? That would do the trick.
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
*** The Support Forum will never ask you for your email or password, so please do not post them anywhere! ***
No support via PM!
Re: Optimize my JavaScript
Well, that's a good idea. Thanks! Solved.TheCrow wrote:@Leiva, that split second is for the javascripts to load. Have you considered adding a loading page to your forum so the javascripts will work and then show the forum? That would do the trick.
Re: Optimize my JavaScript
Problem solved & topic archived.
|
Similar topics
» Javascript
» How to optimize keywords on my forum?
» How to optimize pictures in the post?
» Need help with Javascript
» Optimize your forum referencing with google sitemaps
» How to optimize keywords on my forum?
» How to optimize pictures in the post?
» Need help with Javascript
» Optimize your forum referencing with google sitemaps
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum