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
2 answers
100 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 ?
user avatar
0 votes
2 answers
68 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 ...
user avatar
  • 161
0 votes
1 answer
74 views

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

My tables: dzialki +--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+---...
user avatar
0 votes
0 answers
7 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 ...
user avatar
  • 161
0 votes
0 answers
8 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 ...
user avatar
0 votes
1 answer
31 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,...
user avatar
  • 161
1 vote
0 answers
63 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 ...
user avatar
  • 11
2 votes
2 answers
164 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 ...
user avatar
1 vote
1 answer
21 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. ...
user avatar
0 votes
2 answers
49 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 ...
user avatar
  • 161
1 vote
0 answers
355 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 ...
user avatar
3 votes
1 answer
135 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()->...
user avatar
0 votes
0 answers
50 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 ...
user avatar
1 vote
2 answers
77 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 ...
user avatar
1 vote
1 answer
115 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::...
user avatar
  • 483
1 vote
1 answer
36 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 ...
user avatar
  • 11
0 votes
1 answer
29 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 ...
user avatar
  • 25
0 votes
1 answer
244 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(); ...
user avatar
1 vote
1 answer
302 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 ...
user avatar
  • 25
1 vote
2 answers
636 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 ...
user avatar
0 votes
0 answers
57 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 ...
user avatar
  • 1
1 vote
1 answer
37 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" ...
user avatar
  • 111
2 votes
1 answer
88 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 ...
user avatar
  • 1,369
1 vote
1 answer
82 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', ...
user avatar
  • 483
2 votes
2 answers
240 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 ....
user avatar
1 vote
0 answers
19 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 ...
user avatar
  • 128
1 vote
1 answer
147 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 ...
user avatar
1 vote
1 answer
95 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 ...
user avatar
1 vote
1 answer
69 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....
user avatar
  • 395
0 votes
1 answer
75 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 ...
user avatar
1 vote
2 answers
125 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 ...
user avatar
  • 43
1 vote
1 answer
266 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 ...
user avatar
  • 21
1 vote
1 answer
406 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 ...
user avatar
  • 278
2 votes
2 answers
947 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 ...
user avatar
  • 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 ...
user avatar
  • 1,829
0 votes
3 answers
164 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>?
user avatar
  • 171
1 vote
1 answer
37 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 ...
user avatar
1 vote
1 answer
63 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 ...
user avatar
2 votes
2 answers
285 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 ...
user avatar
0 votes
2 answers
243 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 ...
user avatar
  • 213
2 votes
2 answers
186 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 ...
user avatar
0 votes
1 answer
220 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 ...
user avatar
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 ...
user avatar
1 vote
2 answers
121 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, ...
user avatar
  • 11
0 votes
1 answer
168 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/...
user avatar
  • 11
0 votes
1 answer
240 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 ...
user avatar
  • 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 ...
user avatar
0 votes
1 answer
514 views

Send error or exception returned from ajax request to enqueuemessage

In my componenent on Joomla! 4, when i do an ajax request and that ajax request return an error or exception, i'am wondering how to display it into enqueuemessage. Is-there a way to do it ? Thanks ...
user avatar
-1 votes
1 answer
28 views

How do I find the first NON bootstrap class ancestor of my current module position?

Not sure I'm wording this right so please forgive me. I'm working on a situation where I want to apply the background to the 1st NON .container ancestor of my current module. So, for example.. <...
user avatar
2 votes
1 answer
608 views

Add a Calendar field in Joomla 3.9 without using form xml

I am trying to create a Calendar field in Joomla 3.9 inside my custom component. Since I am framing this inside an AJAX script, I can't use the XML form. Below is the code I am using. The field ...
user avatar
  • 2,651

1
2 3 4 5