Questions tagged [javascript]

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

How to push the menu information for data layer in Joomla?

I have the same forms in different menus. When a user clicks the form link, it will redirect to the form page. In google tag manager, we need to track from which menu the user has been redirected to ...
  • 1
0 votes
0 answers
7 views

Joomla 4: Is it possible to add data from a category blog override into a contact form override?

Summary: I want to pull in Joomla field and input values from a category blog and insert them into a contact form. Background: I have created an alternative menu item based on the category blog for ...
  • 161
1 vote
1 answer
67 views

Joomla layout CSS classes in a view into iFrame

In the chat component I developed there is a View inside an Iframe in the Main View. The component's CSS works normally, but I can't use the standard Joomla layout classes. The HTML is sent by the ...
0 votes
2 answers
660 views

JRequest Method in Joomla 4

JRequest Remove from Joomla 4 then how i must use this method for example $controller->execute( JRequest::getCmd('task', $view) not work i must change it to what ?
0 votes
2 answers
152 views

How can I sort an unordered list alphabetically by class with JavaScript or PHP?

In a custom J4 site I am using the Shack Locations (previously Focalpoint) core extension that displays a dynamically generated legend of location types on the front end, but it is listing the nine ...
  • 161
0 votes
1 answer
82 views

How to return data from 2 tables to one table using a select field

My tables: dzialki +--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+---...
0 votes
0 answers
29 views

How can I dynamically remove tab-index when URL off the page?

In J4.1x I have a three-article carousel, on a 24-second repeating cycle, based on an alternative blog menu item. The carousel works purely with CSS and animation delays of 0, 8 and 16 seconds, with ...
  • 161
0 votes
0 answers
31 views

Rescale Facebook Iframe

I want to embed a Facebook Feed into a Joomla page. I need to find a way to transform the page that opens beyond the last link into "100% Size in the width of the parent container". For ...
0 votes
1 answer
42 views

How can I block a JavaScript script running when a modal is open?

EDIT: I shouldn't have asked this question. See my answer below. I have my own custom template on Joomla 4.0.6 with a simple scroll-to-top function. If I open edit an article on the front end, however,...
  • 161
1 vote
0 answers
64 views

Troubles with Implementation of self written Module for Joomla and Auto Suggest function which should be in Javascript

I am trying to find a way to implement either a self written module in Joomla with PHP code of an dictionary or try to use the dictionary by putting the PHP code in a joomla article with sourcerer ...
  • 11
2 votes
2 answers
236 views

Integrate external news content API into com_content articles

My client is looking to integrate news content coming from an external API into their Joomla website. The API is in the JSON format and includes multiple fields like title, summary, date, and full ...
1 vote
1 answer
22 views

php exclusion in a joomla plugin of the xml sitemap page created by OSMAP

I have trouble uploading OSMAP sitemaps to google because of a plugin I am using. That plugin called autoanchor menu creates a menu based on titles in an article. really usefull for long articles. ...
0 votes
2 answers
55 views

JavaScript toggle code works in J4 but not in J3

I have some simple code that hides or shows a div (that will contain an embedded contact form) when a button is clicked. I first set it up in J4.0.3 and it works fine, but when I tried in J3.10.2 the ...
  • 161
1 vote
0 answers
514 views

React.Js with joomla 4

I searched almost all possible joomla forums to integrate a SPA with joomla 4. I have a SPA with react ready and I want to display it on the administrator side as a component. The only problem is the ...
3 votes
1 answer
248 views

Best Practice: Loading component Styles & Scripts in J4

What is the best practice for loading styles and scripts? Option 1: HTMLHelper::stylesheet(Uri::base().'media/com_mycomponent/css/mycomponent.css'); Option 2: $wa = Factory::getApplication()->...
0 votes
0 answers
58 views

Cannot add Amazon Banner Links in Joomla Site

I am brand new to Joomla and it appears that it does not allow JavaScript codes to run by default. I am running my website on the latest version (3.10). I have looked all around the internet, disabled ...
1 vote
2 answers
111 views

How to create joomla plugin with jquery code

What is the best way how to add jquery code by Joomla plugin? How can I set that these code should be applied just for checkout page of VirtueMart in xml file? Is this the best way? <?php // no ...
1 vote
1 answer
167 views

Use Text-Editor in UIkit Modal (Module Backend)

For a new Project i would like to have an editor instance inside a modal popup (click on an object to add / edit details). I have my Custom Field that loads an editor like so: $editor = JEditor::...
  • 525
3 votes
2 answers
69 views

Place article specific scripts in head section

I'm using a lot of javascript files for my articles. These scripts shouldn't be loaded everywhere - only in certain articles. That's the reason why I don't add them inside of the templates´ head. At ...
  • 31
0 votes
1 answer
32 views

Error in script declaration; Error:Cannot read property '1' of null

I updated plugin JCH Optimize. When it's enabled I get issue: Error in script declaration; Error:Cannot read property '1' of null I tried to exclude this script and css, but it doesn't work. Link ...
  • 25
0 votes
1 answer
425 views

How to Fix PHP Deprecated : Factory::getDocument() is deprecated

How can I fix the following deprecation error generated by my php code? Factory::getDocument() is deprecated $app = Factory::getApplication(); $wa = $app->getDocument()->getWebAssetManager(); ...
1 vote
1 answer
435 views

How to fix "Reduce unused JavaScript" and "Minify JavaScript"

I have a Joomla website that I wish to make faster by following the indications given by the GoogleSpeed Insight page: "Reduce unused JavaScript" and "Minify JavaScript" google ...
  • 25
1 vote
2 answers
1k views

How to add a piece of JavaScript code to the header?

A question from a complete Joomla noob, so bear with me:) I am trying to add a piece of JavaScript code (the Adsense Auto Ads code) to the header files of a Joomla website, but my approaches seem to ...
0 votes
0 answers
91 views

Installing Node.JS and Socket.IO in Joomla

I'm trying to develop a simple chat for my website, I tried with ajax first but then I was recommended to develop it using Socket.IO instead, I saw their demo and everything looks great, I have my ...
  • 1
1 vote
1 answer
53 views

Submitting a form in pure JS

How to get the formDate in the controller? my HTML <form id="myform" > <input type="number" name="jform[option][1]"> <input type="number" ...
  • 121
2 votes
1 answer
132 views

How is Mootools loaded?

A javascript component on my site has stopped working. While debugging I found out it conflicted with Mootools. Only then I realize Mootools is loaded on my page. I remember reading an article saying ...
  • 1,369
1 vote
1 answer
122 views

Joomla 4 - Module Backend Subform subform-row-add "row" not available

while updating one of my modules for J4 i recently noticed that the repeatable subform field no longer provides the added "row" in JS. Working JS for J!3.x: $(document).on('subform-row-add', ...
  • 525
2 votes
2 answers
290 views

addScriptDeclaration is not working

I am trying to add an inline Javascript in my Joomla 4 plugin using addScriptDeclaration().I edited the code like suggested but the plugin is not working .After enabling it , it is not doing anything ....
1 vote
0 answers
24 views

How can I update a Joomla form editor box contents from Javascript?

I have a form with lots of fields including editor fields that display using jce/codemirror. I have buttons that call the submitbutton.js which builds a string from other elements in the form. I can ...
  • 128
1 vote
1 answer
193 views

Google map infowindow stops working on Joomla 1.5 version

My component has the functionality to load google map (Maps API version 3 with valid API key). My infowindow above the marker stops working. One week back everything was smooth and working good. Here ...
1 vote
1 answer
110 views

How to use Openlayers transpiled Javascript code in my own extension (a "bundle")

I am developing a Joomla 3.x content plugin to display Openlayer maps in articles based on @Robbie Jacksons excellent tutorial at https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_a_Map ...
1 vote
1 answer
71 views

Use com_ajax with a custom field

I've created a custom form field for templates, which is meant to handle SCSS compile. In short, I've opened an issue on Github where I had a little chat with one of the Joomla devs about wasm compile....
  • 395
0 votes
1 answer
98 views

Does an AJAX request to a PHP script inherit session context

From JavaScript loaded via a static HTML5 file [loaded from a Joomla page element's onClick event and window.open()], does an AJAX request to a PHP script inherit the session context such that ...
1 vote
2 answers
186 views

How to show multidimensional data in my CanvasJS chart?

<?php $db->setQuery("SELECT MartabehName, COUNT(MartabehCode) FROM `#__dimteacher` GROUP BY MartabehName"); $countMartabehName = $db->loadObjectList(); foreach($countMartabehName ...
  • 43
1 vote
1 answer
284 views

Ajax post request with pure javascript, no jquery

I'm using fabrik to develop some applications, it's great. However I have the need to use ajax with it now, I know how to use it and I already have everything set up, but I need to fix the javascript ...
  • 21
1 vote
1 answer
549 views

TinyMCE editor loaded through AJAX not working

I've built a form that calls for an editor to be loaded through AJAX, but when I insert the fetched contents I get only a <textarea>. If I hit the toggle editor button, then the editor gets ...
  • 278
2 votes
2 answers
1k views

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

I am writing some custom javascript in Joomla 4 Beta 6 to control various aspects of my custom front-end template's menus. It needs to load after the page has been rendered, so I want to add it at the ...
  • 161
0 votes
1 answer
41 views

How can I place a module position in the midpoint of my content no matter what size

I want to put a call to action in the middle of my content no matter what size the content it. I know I will need some JavaScript in order to calculate the word count and the mid point. And I know I ...
  • 1,859
0 votes
3 answers
342 views

Is it possible to add script to the end of the HEAD tag?

when using addScriptDeclaration, the script is added in the first tag that is found inside the HEAD tag. Is it possible to add it just before </HEAD>?
  • 171
1 vote
1 answer
45 views

Joomla trigger event when element in field of “filelist” type is selected

I am struggling since a few days with following problem. Using Joomla 3.9.2x and query 3.5.1. I am trying to display a modal "window" when an item is selected in a Joomla filelist field. I ...
1 vote
1 answer
76 views

Javascript accordion with anchors for joomla

I do not know javascript and scss very well so I am struggling with creating an accordion for a page. I would like two options: When one panel is opened, the other collapses. Every heading of a ...
2 votes
2 answers
341 views

How do I add async attribute for scripts?

I would like to add async to script tags coming from here <jdoc:include type="head" />. I have done some research and I found a few solutions, however those are for custom scripts. I ...
0 votes
2 answers
291 views

Custom module best practices. JS inside template file or not?

I am building a custom module for Joomla. Let's call the module "mod_mygallery". Inside the module I have a the files mod_mygallery.php, helper.php and mod_mygallery.xml. And off course I also have ...
  • 213
2 votes
2 answers
411 views

Js/Ajax function into a Js file doesn't work

I'm not a programmer (This is my hobby, but I like to learn new things). :) I'm developing a JComponent on my side, and I need to integrate an Ajax Call in order to check something. But I have this ...
0 votes
1 answer
315 views

Js : onclick button not triggering

A set of buttons is no longer working and I can't work out why. The site is using Joomla and SP Page Builder Pro. There are 3 buttons that when clicked will change the price table. However these ...
2 votes
1 answer
2k views

Joomla site overrides Array.from() causing Google Maps JavaScript API v3 to not work correctly

I'm working on a custom Joomla module that has an input field, where users can start typing the name of a city and the field offers a list of cities using the Google Places autocomplete API. The ...
1 vote
2 answers
129 views

How to compare current date to article created date?

I need a code to compare if current date and time is greater than article created time of joomla. I have this example code: function CompareDate() { // new Date(Year, Month, Date, ...
  • 11
0 votes
1 answer
191 views

Jquery script loaded on every page

Every page on site has this script Is there any role, seems like of tinymce editor how to disable same, any plugin to disable, as i do not use tinymce on front end of site <script type="text/...
  • 11
0 votes
1 answer
269 views

Another Accordion not functioning [closed]

I created Accordion HTML code for certain element in Joomla builder, but some of the Accordion is not working. FYI, all the Accordion code is in the same page. For first element is working fine, but ...
  • 1
0 votes
0 answers
44 views

Converting to JS

Hello i am still learning but was wondering if anyone here could help i have the two function be low i would like to convert them to JS to store in an external file then be able to call one of the ...

1
2 3 4 5