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
2answers
44 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 ...
1
vote
0answers
40 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 ...
2
votes
1answer
45 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
0answers
27 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
2answers
55 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
1answer
83 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::...
1
vote
1answer
29 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
72 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
1answer
127 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 ...
1
vote
2answers
94 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
0answers
31 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
vote
1answer
30 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" ...
2
votes
1answer
36 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
vote
1answer
43 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', ...
2
votes
2answers
133 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
0answers
15 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 ...
0
votes
0answers
13 views

Why is the JavaScript linked to my Joomla 3.9.25 template.css not working in JCE Editor?

I have a designed a custom template in Joomla 3.9.25. I have also written JavaScript to toggle content from displayed to hidden by clicking a button, similar to Bootstrap's 'collapse' function. The ...
1
vote
1answer
76 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
1answer
51 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
1answer
63 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....
0
votes
1answer
64 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
2answers
103 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 ...
1
vote
1answer
223 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 ...
1
vote
1answer
245 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 ...
2
votes
1answer
339 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 ...
0
votes
1answer
40 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 ...
0
votes
2answers
43 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>?
1
vote
1answer
26 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
1answer
52 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
2answers
213 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
2answers
177 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 ...
2
votes
2answers
89 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
1answer
104 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
1answer
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
2answers
106 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, ...
0
votes
1answer
128 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/...
0
votes
1answer
222 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 ...
0
votes
0answers
39 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 ...
0
votes
1answer
456 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 ...
-1
votes
1answer
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.. <...
2
votes
1answer
493 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 ...
2
votes
1answer
696 views

JS : How to trigger a Blur event with my code

I need help in triggering a Blur event attached to a calendar field. The event I am trying to trigger is added in /media/system/calendar.js around line 1003 JoomlaCalendar.prototype._bindEvents = ...
1
vote
1answer
59 views

How to Update a field only when another filed is changed

My scenario is that I have a field in a table called Stock_Qty that when it is changed I need to update the Stock_Date field with the current date and then the user can replace the date if they don't ...
1
vote
1answer
31 views

JS file not loading on IE, works on Chrome in Joomla Seblod

I have added JS as a field on Joomla Seblod, which calls a JS file in my file system my_profile.js as follows- jQuery.getScript("/components/com_msp/js/my_profile.js") .done(function(script, ...
0
votes
2answers
17k views

was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff)

The files are loaded as so: $document = JFactory::getDocument(); $document->addScript('media/breezingforms/slider-radio/slider-radio/slider-radio.js'); $document->addStyleSheet('media/...
1
vote
2answers
57 views

How to overwrite a module's .php to control what scripts it adds to the head of the doc?

I am new to Joomla. I have installed a plugin and I want to overwrite the module file to remove some of the unwanted scripts. project modules mod_modulename mod_modulename.php How can I overwrite ...
1
vote
0answers
43 views

Cannot insert image in k2 article

I'm facing an issue on the backend side of my Joomla 3.9. I'm using K2 as the content builder and set TinyMCE as default editor. I wanted to insert an image by using the modal button "image", but, as ...
2
votes
4answers
140 views

How to use cookies to populate RSForm fields without notices/warnings?

I have used this code to save the RSForm data in a cookie and if the user tries to fill in the same form again, the previously entered data is loaded as default values: Script called on form display: ...
2
votes
1answer
449 views

TypeError: Form is Null on Button in Admin toolbar

I am receiving TypeError: form is null in the browser console when I select a custom button added to a form using JToolbarHelper. I can insert the button to any other component as is and it will ...

1
2 3 4 5