The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
3 posters

    Code not running at loading

    Niko
    Niko
    Helper
    Helper


    Male Posts : 3233
    Reputation : 249
    Language : English, Italian, French
    Location : Italy

    Solved Code not running at loading

    Post by Niko 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
    SSYT
    SSYT
    Forumember


    Male Posts : 77
    Reputation : 15
    Language : RO-10, EN-3, FR-1
    Location : Romania

    Solved Re: Code not running at loading

    Post by SSYT 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');
            }
        };
    });
    Niko
    Niko
    Helper
    Helper


    Male Posts : 3233
    Reputation : 249
    Language : English, Italian, French
    Location : Italy

    Solved Re: Code not running at loading

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

    I solved on my own Wink

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


    Male Posts : 51499
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Code not running at loading

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

    Thanks for posting the solution.

    Topic Solved & Archived



    Code not running at loading Slgray10

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

      Current date/time is September 23rd 2024, 1:20 pm