Code not running at loading

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
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
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');
        }
    };
});
avatar
SSYT
Forumember

Male Posts : 69
Reputation : 12
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:
avatar
Niko
Hyperactive

Male Posts : 2299
Reputation : 98
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.

avatar
SLGray
Administrator
Administrator

Male Posts : 43114
Reputation : 3055
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

Back to top


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