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.

Code not running at loading

View previous topic View next topic Go down

Solved Code not running at loading

Post by Niko on May 27th 2014, 11:34 pm

Hello

I have this code that should be executed when the page opens, but it doesn't pale

where is the mistake?
Code:
$(window).load(function() {

if(_userdata["user_posts"] < 1 && _userdata["session_logged_in"] == '1'){
      $('#fa_toolbar').before('HTML CONTENT');
}
});

actually I tried to run it via the google chrome console and it worked, but not from Javascript panel in ACP  What a Face 

Thanks in advance


Last edited by Niko! on May 29th 2014, 5:48 pm; edited 1 time in total

Niko
Hyperactive

Male Posts : 2298
Reputation : 97
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Code not running at loading

Post by SSYT on May 28th 2014, 6:47 am

Try, i'm not 100% to working.
Code:
jQuery(function($) {
    window.onload=function() {
        if(_userdata.user_posts == '0' || _userdata.session_logged_in == '1') { /* 0 or -1 try of user_post */
            $('#fa_toolbar').before('HTML CONTENT');
        }
    };
});

SSYT
Forumember

Male Posts : 41
Reputation : 2
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Solved Re: Code not running at loading

Post by Niko on May 29th 2014, 8:48 pm

I solved on my own Wink

Instead of using .load, I used another method
thanks anyway :rose:

Niko
Hyperactive

Male Posts : 2298
Reputation : 97
Language : English, French, Italian, Spanish, Latin

Back to top Go down

Solved Re: Code not running at loading

Post by SLGray on May 30th 2014, 2:55 am

Thanks for posting the solution.

Topic Solved & Archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36708
Reputation : 2446
Language : English
Location : United States

http://ztwds.forumotion.com/

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