Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 649 Bytes

File metadata and controls

33 lines (21 loc) · 649 Bytes

Javascript

Variable name convention

Write variable names in camelCase format

e.g. windowHeight

Change these

var window-height;
var window_height;
var WindowHeight;

To this

var windowHeight;

Using language constants

Step 1. Define language constant in language file

COM_EKCONTENT_CONTENT_STAT_GENIE_VIEW_TITLE="Genie visits over time"

Step 2. Load this constant on page by doing [load in view.html or in layout file]

JText::script(COM_EKCONTENT_CONTENT_STAT_GENIE_VIEW_TITLE);

Step 3. Use in javascript [js file]

var msg = Joomla.JText._(COM_EKCONTENT_CONTENT_STAT_GENIE_VIEW_TITLE);