Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 168

JavaScript is a dynamically-typed language commonly used for client-side scripting. Unless a tag for a framework/library is also included, a pure JavaScript answer is expected.

1 vote

Change Element Background During Scroll

Just an addition to @Johanpw's answer. jQuery has some issues with the !important attribute when using .css() which you're going to have to use as Bootstrap is using it. Here are 2 alternatives that y …
Lodder's user avatar
  • 26.9k
3 votes

Joomla $document->addScriptDeclaration with single quote and double quote

You need to escape the quotes using backwards slashes like so: // No direct access defined('_JEXEC') or die; //JHtml::addIncludePath(JPATH_COMPONENT.'helpers/html'); JHtml::_('behavior.tooltip'); JH …
Lodder's user avatar
  • 26.9k
0 votes

Changing order of javascripts on load

Have you considered trying the following? <jdoc:include type="head" /> <script src="js/jquery.uitablefilter.js" /> <script src="js/filterTable.js" />
Lodder's user avatar
  • 26.9k
1 vote

Add javascript after a form or at the end of the page

You simply need to put your Javascript after the form, where ever it's being rendered from: <form method="post" action=""> // rest of form code </form> <script> // you Javascript code </script …
Lodder's user avatar
  • 26.9k
1 vote

Where can I find piwik JavaScript code

The files for the plugin are located in the following directory: ROOT/plugins/system/piwik The following file is the one that displays the parameter allowing you to add your tracking code: ROOT/pl …
Lodder's user avatar
  • 26.9k
5 votes

Dynamic JS and CSS combining without JCH Optimize

JCH Optimize is one of those plugins where you should not simply select everything to be optimised and expect your site to be 2x faster in loading speeds. The more you try and optimise, the more proce …
Lodder's user avatar
  • 26.9k
1 vote
Accepted

Dynamically change ID of a href based on page class

You can get the page class suffix, like so: $menu = JFactory::getApplication()->getMenu()->getActive(); $class = $menu->params->get('pageclass_sfx'); and then add it as an ID so your anchor, like …
Lodder's user avatar
  • 26.9k
2 votes
Accepted

What is the correct way to add Javascript as of Joomla 3.x?

So to answer you actual question, the correct way to add Javascript to your site will be as following: General: JFactory::getDocument()->addScriptDeclaration(' alert(1); // more Javascript here …
Lodder's user avatar
  • 26.9k
1 vote

My Joomla Template is loading my custom CSS using JS. Is there a way to add the unique versi...

Another automated approach would be to append the current date (year/month/day) which would result in your version being updated daily, like so: $today = JFactory::getDate()->format('Ymd'); JHtml::_( …
Lodder's user avatar
  • 26.9k
0 votes

How to compare current date to article created date?

I'll assume you're using an inline script inside a PHP file. Depending on how you're fetching the creation date of the article, you may need to make some minor modifications: // Get the creation date …
Lodder's user avatar
  • 26.9k
0 votes
Accepted

Js : onclick button not triggering

The problem is that your buttons are using the on-click attribute, which isn't valid. You need to use onclick instead. Replace: on-click="tripleCoverDlFold1()" with: onclick="tripleCoverDlFold1() …
Lodder's user avatar
  • 26.9k
0 votes

JavaScript toggle code works in J4 but not in J3

I'm not sure why it would be working in J4, but not J3. That said, you're unecessarily using nested for loops, rather than a single forEach iterator. You can use the following: // Create an array usin …
Lodder's user avatar
  • 26.9k
1 vote

Adding a timepicker to a datepicker

I think I know what the issue may be, you need to wrap your code around jquery's document ready like so: jQuery(document).ready(function($){ var x = $(this).attr("size"); $(t …
Lodder's user avatar
  • 26.9k
4 votes
Accepted

How can I add a local custom javascript file into the bottom of the template's index.php file?

It means a Javascript module which is deferred automatically. …
Lodder's user avatar
  • 26.9k
11 votes
Accepted

Add JavaScript with $doc->addScript with async="true"

If you have a look at the Joomla addScript function, it shows the following: public function addScript($url, $type = "text/javascript", $defer = false, $async = false) { $this->_scripts[$url]['mime … scripts[$url]['defer'] = $defer; $this->_scripts[$url]['async'] = $async; return $this; } $async is a boolean therefore the following should work for you: $doc->addScript('//myscript.js', 'text/javascript
Lodder's user avatar
  • 26.9k

15 30 50 per page