Forums

javascript being repeated...

drewgg 06 Apr, 2009
the javascript that is put in the header file...

  <script type="text/javascript">var CommentPublished = 1;
var CommentVerified = 1;
var path = 'http://charismamag.com/';
var imtype = '0';
var captcha = 1;
var hideemail = 1;
var hideurl = 1;
var loadercolor = 'b';
var ENTER_NAME = 'Please Enter Your Name';
var NAME_LENGTH = 'Name length Should not exceed 50 characters';
var ENTER_COMMENT = 'Please Enter Your Comment!';
var ENTER_EMAIL = 'We need your valid email address for verifications!';
var URL_HTTP = 'Your URL should contain http://';
var WRONG_CODE = 'You have entered a wrong security code, please retry!';
var NOT_VERIFIED = 'Thank you, We have sent you an Email with a verfication link, please click it to verify your comment!';
var NOT_PUBLISHED = 'Thank you, your comment will be published once reviewed.';
var UNPUBLISHED_SUCCESS = 'Unpublished Successfully!';
var GUEST_CANT_VOTE = 'You need to login to vote';
var OWNER_CANT_VOTE = 'You can not vote because you are the owner or you already voted!';
</script>
  <script type="text/javascript" src="http://charismamag.com/components/com_chronocomments/scripts.js"></script>
  <!--[if lte IE 6]> <link href="http://charismamag.com/components/com_chronocomments/style-ie6.css" rel="stylesheet" type="text/css" /> <![endif]-->
  <!--[if gte IE 7]> <link href="http://charismamag.com/components/com_chronocomments/style.css" rel="stylesheet" type="text/css" /> <![endif]-->
  <!--[if !IE]> <--><link href="http://charismamag.com/components/com_chronocomments/style.css" rel="stylesheet" type="text/css" /><!--> <![endif]-->
  <script type="text/javascript" src="http://charismamag.com/components/com_chronocomments/editor.js"></script>


...is being repeated 5-20 times on every page of my site, even though chronocomment is only set for one specific section. With that many link and script calls in this block of code, having it repeat 20 times is obviously causing load issues. I noticed the demo version this code is there only once.

I haven't done anything weird to the core files so I'm not sure why this is happening, any ideas?

Where in the ChronoComment code is this stuff added to the header? I may be able to figure it out on my end if I at least learn that part.

Thanks for any help you can provide!
GreyHead 07 Apr, 2009
HI drewgg,

There is a fix for this that Max has posted in the forums here. Right now I can't find it - perhaps Max remembers where it is.

Bob
GreyHead 07 Apr, 2009
Hi drewgg,

Excellent, well found - I went all through the ChronoComments 'Bugs forum :-(

Bob
rimmazz 14 May, 2009
How can I make JavaScript easier for me to learn? I have had a bad history with JavaScript. I could code simple things, like pop-up windows and small, useless applications, but nothing else. I gave up on JavaScript a while ago. HTML was a little hard for me to learn, though. JavaScript is too overwhelming for me. I get a blank mind sometimes when I code in JavaScript.
______________________
market samurai ~ marketsamurai ~ marketsamurai.com
GreyHead 16 May, 2009
Hi rimmazz,

I share the same feeling. Because JavaScript is event-driven it's very driven from more linear programming.

My best advice is to find some good references and then to find some small tasks and code them. Also W3Schools generally have good tutorials - haven't really tested the JavaScript ones though.

Bob
This topic is locked and no more replies can be posted.