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
4 posters

    Problems with JS

    Amadeus
    Amadeus
    Forumember


    Female Posts : 157
    Reputation : 1
    Language : Polish, English
    Location : Poland

    Solved Problems with JS

    Post by Amadeus May 17th 2020, 4:16 pm

    Hello, everyone. I would like to ask for help with javascript related to Chatbox login and logout. When I applied this JS unfortunately it didn't work for me on the forum because I didn't have these tags disappeared. And I want you to be able to write on this chatbox without logging in. This Js only works on two browsers Firefox and Miscrosoft Edge. I'm asking nicely for help.

    Code:
    $(window).load(function() {
     var chatbox_script = function() {
     $('#chatbox > p > .msg > span').filter('[style="color:green"],[style="color:red"]').closest('p').remove();
     var overrided = Chatbox.prototype.refresh;
     Chatbox.prototype.refresh = function(data) {
     if (data.messages && data.messages.length) {
     data.messages = $.grep(data.messages, function(v) {
     return v.userId != -10 || $.inArray(v.msgColor, ["red", "green"]) == -1;
     });
     }
     overrided.call(this, data);
     };
     };
     var s=document.createElement('script');s.text="("+chatbox_script.toString()+")();";$('object[data^="/chatbox"],iframe[src^="/chatbox"]').each(function(){try{$(this.contentDocument||this.contentWindow.document).find("#chatbox").closest("html").find("head").first().each(function(){this.appendChild(s.cloneNode(true))})}catch(a){}})
     });

    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Problems with JS

    Post by TheCrow May 17th 2020, 7:00 pm

    Hello @Amadeus,

    So this code is not working for you? On what browser are you referring to and what do you mean on "this chatbox" ?

    Regards,
    TC.



    Problems with JS Thecro10
     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!
    Amadeus
    Amadeus
    Forumember


    Female Posts : 157
    Reputation : 1
    Language : Polish, English
    Location : Poland

    Solved Re: Problems with JS

    Post by Amadeus May 17th 2020, 7:25 pm

    Hello. Unfortunately, he's not working on phpbb2 with me. I use Google Chrome every day, sometimes Maxthon, but it's very rare.
    TheCrow
    TheCrow
    Manager
    Manager


    Male Posts : 6916
    Reputation : 795
    Language : Greek, English

    Solved Re: Problems with JS

    Post by TheCrow May 17th 2020, 7:39 pm

    It works fine to me using Google Chrome and on my testing #Phpbb2 version forum.

    Have you tried clearing your browser's history and the cookies and cache?

    Regards,
    TC.



    Problems with JS Thecro10
     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!
    Neptune-
    Neptune-
    Forumember


    Female Posts : 496
    Reputation : 104
    Language : French (10), English (8), CSS (5), HTML (4), Javascript (4)
    Location : Scotland, UK

    Solved Re: Problems with JS

    Post by Neptune- May 17th 2020, 8:18 pm

    Hello,


    What is the exact URL of the page where the chatbox is placed ?
    Amadeus
    Amadeus
    Forumember


    Female Posts : 157
    Reputation : 1
    Language : Polish, English
    Location : Poland

    Solved Re: Problems with JS

    Post by Amadeus May 18th 2020, 5:05 pm

    Okey I delete cookies and working. Thank you for help
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    Solved Re: Problems with JS

    Post by skouliki May 18th 2020, 5:32 pm

    Problem solved & topic archived.
    Please read our forum rules:  ESF General Rules


      Current date/time is November 14th 2024, 1:07 pm