×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Javascript code between head tags

Javascript code between head tags 13 years 1 month ago #14431

  • Steve Boulden
  • Steve Boulden's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Karma: -9
  • Thank you received: 0
The following code is in the head area of my pages that have compojoom. Shouldn't it be in an external javascript file? I looked at several sites here in the showcase and none seem to have this in them. I've checked all my settings but can't get rid of it. Thanks for your help.


var COM_COMMENT_MSG_DELETE = "Are you sure you want to delete this comment?"; var COM_COMMENT_MSG_DELETEALL = "Are you sure you want to delete all comments?"; var COM_COMMENT_WRITECOMMENT = "Write comment"; var COM_COMMENT_SENDFORM = "Send"; var COM_COMMENT_EDITCOMMENT = "Edit comment"; var COM_COMMENT_EDIT = "Edit"; var COM_COMMENT_FORMVALIDATE = "Please insert at least a comment."; var COM_COMMENT_FORMVALIDATE_CAPTCHA = "Please input the anti-spam code that you can read in the image."; var COM_COMMENT_FORMVALIDATE_CAPTCHA_FAILED = "Anti-spam code is not correct. Please input the code that you can read in the image."; var COM_COMMENT_FORMVALIDATE_EMAIL = "To be notified, please enter your email"; var COM_COMMENT_FORMVALIDATE_INVALID_EMAIL = " Please enter valid email address"; var COM_COMMENT_ANONYMOUS = "Anonymous"; var COM_COMMENT_BEFORE_APPROVAL = "Your comment has been queued for moderation by site administrators and will be published after approval."; var COM_COMMENT_REQUEST_ERROR = "Request failed"; var COM_COMMENT_MSG_NEEDREFRESH = "";
function keepAlive() { var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(2640000); });
window.addEvent('domready', function() {
$$('.hasTip').each(function(el) {
var title = el.get('title');
if (title) {
var parts = title.split('::', 2);
el.store('tip:title', parts[0]);
el.store('tip:text', parts[1]);
}
});
var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
});

Javascript code between head tags 13 years 1 month ago #14441

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Steve,
Is there a general trend right now to remove all js from the head of the page that I don't know about???

this code here:
function keepAlive() {    var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(2640000); });
        window.addEvent('domready', function() {
            $$('.hasTip').each(function(el) {
                var title = el.get('title');
                if (title) {
                    var parts = title.split('::', 2);
                    el.store('tip:title', parts[0]);
                    el.store('tip:text', parts[1]);
                }
            });
            var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
        });

doesn't belong to hotspots, but I think that it belongs to joomla 1.7. You see with older versions of joomla there was always the problem, that when writing an article your session would expire and now in the backend while you surf your page it sends an ajax request and it renews your session...

About the other variables - that are language strings. In a future version it will be just a single variable commentLanguage that will contain all those.

Cheers,
Daniel

Javascript code between head tags 13 years 1 month ago #14449

  • Steve Boulden
  • Steve Boulden's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Karma: -9
  • Thank you received: 0
Hi Daniel.

I don't know. I haven't heard of any trend to take out javascript or css. It's interesting that you say that. However, I do know there is a concern to reduce code bloat and place as much code off page as possible by using referrers to call it from an off page location. It's apparent and obvious if you look at the source of newer Joomla and most sites being built today.

As I looked through the Joomla site showcase and actually even sites listed here with an older version of your software, I don't see all this "language string" in the head. So I was simply curious if I had installed your software incorrectly. Maybe I overlooked it somehow but it seems that older versions of your software don't have this language string.

Anyway, as page load times and code to content ratio continues to become more of a consideration in SEO and as many of the top ranking sites are obviously following that trend, I have simply began looking at my own code which made me notice this new language string in the head of my pages. And again, as I looked at sites with older versions of your software that don't have this, it made me wonder if I had installed it incorrectly.

Thanks for your reply.

Javascript code between head tags 13 years 1 month ago #14453

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Steve,
I see! Well, to be honest this strings should be in all versions of the comment system - I think that they were there also with version 3, but I'm not running any older version of the comments to check now.
Anyway - as I said the plan is to move this to a single json object that will hold the language strings and maybe move it to a separate file. And the other plan is to bring the js of the component to the state of the ART :)

Cheers,
Daniel

Javascript code between head tags 13 years 1 month ago #14459

  • Steve Boulden
  • Steve Boulden's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Karma: -9
  • Thank you received: 0
It's a great component as it is. It's just my opinion. But for me, that will make it even better.

I'll be looking forward to it.

Thanks again.
  • Page:
  • 1
Time to create page: 0.151 seconds