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.

JS Code Blocking Chatbox

+2
Pizza Boi
J0k3R^
6 posters

Go down

Solved JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 9:31

Hi  Hello 
i realized that a code on my js is blocking my chatbox popup.
i dont know js language, can somebody tell me what is this and if its necessary (maybe for other codes) ?
thanks  :rose: 


Code:
$(function() {
      var x = document.getElementById('variables').getElementsByTagName('span');
      for (var i = 0, v; (v = x[i++]); ) {
            $('.' + v.id).html(v.innerHTML);
            $('.' + v.id + '-replace').each(function(i, e) {
                e.innerHTML = e.innerHTML.replace( RegExp('{' + v.id + '}', 'g') , v.innerHTML );
            });
      }
    });
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi Wed 23 Apr - 9:35

J0k3R^ wrote:Hi  Hello 
i realized that a code on my js is blocking my chatbox popup.
i dont know js language, can somebody tell me what is this and if its necessary (maybe for other codes)?


Code:
$(function() {
      var x = document.getElementById('variables').getElementsByTagName('span');
      for (var i = 0, v; (v = x[i++]); ) {
            $('.' + v.id).html(v.innerHTML);
            $('.' + v.id + '-replace').each(function(i, e) {
                e.innerHTML = e.innerHTML.replace( RegExp('{' + v.id + '}', 'g') , v.innerHTML );
            });
      }
    });

Hi Very Happy

Judging from this line alone: var x = document.getElementById('variables').getElementsByTagName('span'); you can safely say that it involves anything that has span="variables". See the word Tag and ID? That technically makes up the one I just said.

The code just says that anything in the span="variables" will get replaced by a specific, I'm just not sure what it'll be replaced with since I'm sure that this isn't the full code right now.

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 9:40

is it possible to be related with my tabs on footer?

JS Code Blocking Chatbox SpDcNQE

because my JS's code is named "FooterTabs2" and i have one more called "FooterTabs1" ↓ (the following)

Code:
Codes Removed

but when i disable the "FooterTabs2" (Placement: nothing) my forum's tabs are still working fine, atleast they seem so..


Last edited by J0k3R^ on Wed 23 Apr - 9:51; edited 1 time in total
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi Wed 23 Apr - 9:47

Hi Very Happy

No, it's not related, just search for something that involves span="variable".

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 9:50

yeah, i already tried that and i found nothing at css or templates


- Maybe i had removed the codes that were related with this js, is it possible right? Smile
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by DangerZone Wed 23 Apr - 9:58

Easiest way to test is: Remove the JS and test if everything works Wink Save the JS in a document, in case you suddenly realize a malfunction on your website.
DangerZone
DangerZone
Forumember

Female Posts : 27
Reputation : 5
Language : .

http://downuptown.danskforum.net/

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 9:59

DangerZone wrote:Easiest way to test is: Remove the JS and test if everything works Wink Save the JS in a document, in case you suddenly realize a malfunction on your website.

Good, i will go do that and will come back for feedback
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi Wed 23 Apr - 11:24

J0k3R^ wrote:yeah, i already tried that and i found nothing at css or templates


- Maybe i had removed the codes that were related with this js, is it possible right? Smile

Hi Very Happy

Yeah, that's highly probable and to be honest, I think I saw that code before. I saw a site that had it along with an avatar placed in the upper part of the header.

Anyway, just do what DZ says.

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas Wed 23 Apr - 11:36

why to not make a pop up javascript chatbox
Code:
jQuery(document).ready(function(){
jQuery('body').append('<span id="chatButton" title="Open/Close Chatbox">Open Chat</span><div id="chatBox"><iframe src="/chatbox/index.forum"></iframe></div>');
jQuery('#chatBox').hide();
jQuery('#chatButton').css('position', 'fixed').css('right', '0px').css('bottom', '0px');
jQuery('#chatBox iframe').css('position', 'fixed').css('right', '10px').css('bottom', '45px');
if(!document.getElementById('logout')){
jQuery('#chatButton').hide();
jQuery('#chatBox').hide();}
jQuery('#chatButton').click(function(){
jQuery('#chatBox').fadeToggle();
});
});
Jack Atlas
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 11:41

Jack Atlas wrote:why to not make a pop up javascript chatbox
Code:
jQuery(document).ready(function(){
jQuery('body').append('<span id="chatButton" title="Open/Close Chatbox">Open Chat</span><div id="chatBox"><iframe src="/chatbox/index.forum"></iframe></div>');
jQuery('#chatBox').hide();
jQuery('#chatButton').css('position', 'fixed').css('right', '0px').css('bottom', '0px');
jQuery('#chatBox iframe').css('position', 'fixed').css('right', '10px').css('bottom', '45px');
if(!document.getElementById('logout')){
jQuery('#chatButton').hide();
jQuery('#chatBox').hide();}
jQuery('#chatButton').click(function(){
jQuery('#chatBox').fadeToggle();
});
});

u skipped css code because this code is not full  :rose:
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by TheCrow Wed 23 Apr - 11:47

Το me the chatbox opens fine! The and i can login fine also. What is the problem?
TheCrow
TheCrow
Manager
Manager

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

https://forumote.forumotion.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas Wed 23 Apr - 11:48

yea this sorry ^^
Code:
/*Chatbox*/
#chatButton{
box-shadow:0px 10px 6px rgba(255,255,255, 0.2) inset, 0px -10px 6px rgba(0,0,0, 0.2) inset;
padding:10px 20px 10px 20px;
background-color:#000000;
border:1px solid #146;
font-weight:bold;
font-size:10px;
z-index:999;
color:#fff;
}
#chatButton:hover{
cursor:pointer;
color:#ff0000;
background-color:#000000;
}
#chatBox iframe{
z-index:999;
border:none;
height:50%;
width:65%;
}
#chatButton{
bottom:20px !important;
}
#chatBox iframe{
bottom:60px !important;
}
in css
Jack Atlas
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi Wed 23 Apr - 11:56

Hi Very Happy

Hey, man, this is the one I use for my site, just add it anywhere (Preferably on top of your overall_header template) in anything that accepts HTML. Make sure to change the picture though...

Code:
<div style="overflow: visible; position: fixed; bottom: 30px; height: 350px; right: 0px; z-index:10000; "><iframe src="/chatbox/index.forum" id="chatboxpop" scrolling="yes" style="overflow: visible; width: 750px; height: 350px; display: none; float:right;box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);margin-left: 6px; -moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;" marginwidth="0" marginheight="0" frameborder="0"></iframe><div onclick="jQuery('#chatboxpop').animate({width:'toggle'},1200); jQuery('#chatboxopen,#chatboxclose').toggle();" style="cursor :pointer; float:left; box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;  padding: 6px 3px 6px 3px; position:relative; top:120px;"><img src="http://i.imgur.com/cfSuv2I.png" id="chatboxopen"><img src="http://i.imgur.com/FmfFT1j.png" id="chatboxclose" style="cursor :pointer; display:none;"></div></div>

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 11:59

omg, its a triple chatbox 
JS Code Blocking Chatbox VQySIZv


just kidding.. thanks for the chatbox @Jack Atlas


JS Code Blocking Chatbox Aufkleber_Trollface



But should i remove this code from js? (this at first post)

Pizza Boi wrote:Hi Very Happy

Hey, man, this is the one I use for my site, just add it anywhere (Preferably on top of your overall_header template) in anything that accepts HTML. Make sure to change the picture though...

Code:
<div style="overflow: visible; position: fixed; bottom: 30px; height: 350px; right: 0px; z-index:10000; "><iframe src="/chatbox/index.forum" id="chatboxpop" scrolling="yes" style="overflow: visible; width: 750px; height: 350px; display: none; float:right;box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);margin-left: 6px; -moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;" marginwidth="0" marginheight="0" frameborder="0"></iframe><div onclick="jQuery('#chatboxpop').animate({width:'toggle'},1200); jQuery('#chatboxopen,#chatboxclose').toggle();" style="cursor :pointer; float:left; box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-webkitbox-shadow: 0px 0px 3px rgba(0,0,0,0.25);-o-box-shadow: 0px 0px 3px rgba(0,0,0,0.25);-moz-border-radius: 6px;border-radius: 6px;-webkit-border-radius: 6px;-o-border-radius: 6px;  padding: 6px 3px 6px 3px; position:relative; top:120px;"><img src="http://i.imgur.com/cfSuv2I.png" id="chatboxopen"><img src="http://i.imgur.com/FmfFT1j.png" id="chatboxclose" style="cursor :pointer; display:none;"></div></div>

Regards,
Pizza Boi

thanks, im just using a simple, small and convenient button for popup chat  :rose:
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi Wed 23 Apr - 12:02

Hi Very Happy

Generally speaking, I'd save it first and then if and only if you see a problem to occur, I'd re-install the script and see if it fixes that problem, for now, just have it backed up but removed from your forum~

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 12:03

Pizza Boi wrote:Hi Very Happy

Generally speaking, I'd save it first and then if and only if you see a problem to occur, I'd re-install the script and see if it fixes that problem, for now, just have it backed up but removed from your forum~

Regards,
Pizza Boi

got it, thanks for codes and help guys.

mark as *Solved*
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Pizza Boi Wed 23 Apr - 12:04

Hi Very Happy

The pizza's here! That'd be $2.99 Wink .

No problem~

Regards,
Pizza Boi
Pizza Boi
Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas Wed 23 Apr - 12:07

heyo don't remove the javascript
Jack Atlas
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by J0k3R^ Wed 23 Apr - 12:14

Jack Atlas wrote:heyo don't remove the javascript

i dont remove yours, it was question about the first post javascript Smile
J0k3R^
J0k3R^
Forumember

Male Posts : 742
Reputation : 28
Language : Greek > English > Russian > Spanish
Location : C:\>r00t

http://fmplanet.forumgreek.com

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by Jack Atlas Wed 23 Apr - 12:29

yea ok Razz
Jack Atlas
Jack Atlas
Forumember

Posts : 100
Reputation : 1
Language : english

http://hdaduelacademy.forumotion.com/forum

Back to top Go down

Solved Re: JS Code Blocking Chatbox

Post by SLGray Wed 23 Apr - 17:37

Topic Solved & Archived


JS Code Blocking Chatbox Slgray10

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

Male Posts : 51463
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top


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