Login
Remember
Register
References
Ranks
Add reference
Drupal - JS condition for frontpage and not
0
votes
292
views
added
Nov 14, 2018
in
Drupal
by
LC Marshal
Captain
(
25,790
points)
if ($('body').hasClass('front')) { // do something } else { // do something else }
drupal
jquery
javascript
condition
frontpage
Related reference
FIX: Uncaught TypeError: $ is not a function in Drupal
Drupal - add JS code
PHP - Condition within condition
Drupal - Add external JS
Drupal - create form and validation
Drupal - function drupal_is_front_page
Drupal - Add external code into project
jQuery - if not condition
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
All categories
API
(35)
React
(149)
Javascript
(100)
Next JS
(10)
jQuery
(176)
CSS
(141)
SCSS
(25)
UI design
(1)
Vue
(25)
JSX
(12)
ES6
(8)
Regex
(6)
PHP
(62)
mySQL
(9)
Drupal
(15)
Bootstrap
(22)
Repository
(41)
Software & tools
(38)
Google tools
(28)
Plugins
(13)
Gulp
(9)
NPM
(9)
Node JS
(7)
CMS
(9)
Command-line
(7)
Database
(2)
Domain & hosting
(16)
Elixir
(1)
HTML
(22)
Networking
(4)
Python
(0)
Server issues
(12)
VM & Remote desktop
(2)
VSCode
(7)
Windows
(11)
XSLT
(5)
General
(868)
...