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.

Problems with JS

4 posters

Go down

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){}})
 });

Amadeus
Amadeus
Forumember

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

Back to top Go down

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.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6878
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

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.
Amadeus
Amadeus
Forumember

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

Back to top Go down

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.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6878
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

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 ?
Neptune-
Neptune-
Forumember

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

https://www.galaxie-series.net/

Back to top Go down

Solved Re: Problems with JS

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

Okey I delete cookies and working. Thank you for help
Amadeus
Amadeus
Forumember

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

Back to top Go down

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
skouliki
skouliki
Manager
Manager

Female Posts : 14247
Reputation : 1636
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top

- Similar topics

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