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
1answer
85 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/...
1
vote
1answer
42 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
61 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
2answers
32 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>?
0
votes
0answers
12 views

Can I close mobile menu on click for anchor links

I have this small Joomla project and I need help with the mobile menu. The anchor links just scroll but the menu doesn't close. Is there any script I can add to the index.php? I'm using Joomla3 3x. ...
0
votes
1answer
33 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
vote
1answer
42 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
19 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
1k views

Add click event on bootstrap tab?

How to add an onClick event on Joomla bootstrap tabs. https://api.joomla.org/cms-3/classes/JHtmlBootstrap.html echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'monday')); echo ...
1
vote
2answers
57 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
374 views

Parsing Error Javascript in php include page on the test server

We're getting this error in our test environment: Parse error: syntax error, unexpected 'var' (T_VAR) in /home/usaspo5/public_html/dev/usgnew/components/com_usg_programs/tmpls/default.php We have ...
0
votes
1answer
55 views

Send values from article to article

I have two articles in my Joomla site. One article has various links to the same article. The other article display, with code of java script, the HTML content of a file depending on what link was ...
1
vote
1answer
41 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 ...
3
votes
3answers
1k views

How to remove the type attribute from script tags of an Html5 document?

From the beginning of december 17, W3C XHTML started to point out this error: The type attribute is unnecessary for JavaScript resources. The above warning is generated inside Joomla script itself ...
2
votes
2answers
94 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
72 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 ...
0
votes
1answer
22 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
773 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 ...
2
votes
2answers
45 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 ...
3
votes
1answer
260 views

How to use HTMLHelper to add to the document head

In this post: How to add CSS/JS/an Image to a module backend @lodder shows me how to use HTMLHelper to add CSS and JavaScript. Previously I had followed the Joomla! documentation https://docs.joomla....
0
votes
0answers
28 views

Not shown my component javascript code in developer tools

I have simple joomla component with some php pages on that exists inline javascript code. I added "debugger;" word in my js-code to debug it, but when I open my page in chrome with dev tools my code ...
0
votes
1answer
131 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
1answer
147 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 ...
0
votes
0answers
37 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 ...
2
votes
1answer
260 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 ...
4
votes
2answers
451 views

How to use joomla language in a script?

I'm developing a module, in my template (MyModule/tmpl/default.php) I'm able to bring my language string to my script by doing this : <script type="text/javascript"> Mymodule.options.mydz = {...
-1
votes
1answer
27 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
67 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 = ...
3
votes
3answers
782 views

How to check JSESSION in javascript

I am developing a component and I use ajax calls to do some tasks in the frontend. I have come to a problem when the session is expires and I don't want to use keepalive to solve it. In the frontend ...
1
vote
1answer
25 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
11k 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/...
2
votes
4answers
110 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: ...
1
vote
2answers
50 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 ...
0
votes
1answer
312 views

Make calendar dynamically in 3.7

I recently found out that the datepicker and calendar changed a lot from 3.6 to 3.7 and as a result I'm having a problem with my custom backend component. Originally this is the code I was using to ...
1
vote
0answers
30 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 ...
1
vote
3answers
236 views

Insert custom text to JCE using Javascript

How to insert custom text to JCE v. 2.3.4.4 using javascript? I have opened the page source and saw that the editor is an iframe. Text is in <body id="tinymce">. I was trying something like: $...
2
votes
1answer
202 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 ...
2
votes
2answers
44 views

Link to Page & Pre-Filter Portfolio Items

Joomla 3.9.10 I am using this template. I would like to create a link on my home page that when clicked, will take the user to the portfolio page and display a pre-selected tab.. For example my link ...
2
votes
1answer
63 views

SEF URL Broken Image Links When Fetching API Results

Using Joomla 3.9.8 I'm using the fetch() api in order to retrieve some data from a remote API. When I have the api results I'm displaying them in html elements. The API returns various values, one ...
2
votes
1answer
51 views

If I want to globally include a framework aside from jQuery?

I know I can use many of the items found in this documentation such as jQuery https://docs.joomla.org/J3.x:Javascript_Frameworks by doing something simple like this JHtml::_('jquery.framework', ...
1
vote
2answers
66 views

Joomla 3.9.X: Website speed on page speed

I have a site with joomla with a good template and excellent performance. The only problem remains the same: the speed for mobile on google pagespeed. On my site with joomla 3.9.x I have activated all ...
0
votes
0answers
104 views

Presentation API PresentationRequest is not defined

I've been trying to integrate this API: https://googlechrome.github.io/samples/presentation-api/ with my project. However, it always generates this error in the browser console: Uncaught ...
0
votes
0answers
21 views

Javascript in administration (modules / content-plugins) [duplicate]

i have one doubt / question and don't know how to solve it: Imagine you have a subform-field with the multiple-parameter active to add multiple content-blocks, now, the thing is, in real life there ...
3
votes
1answer
795 views

Placing inline javascript into the head tags of one page only

I'm using the Sourcerer extension to send script to my header tags on specific pages to comply with the new gtag requirements of placing conversion tags in the head tags of pages that you want to ...
1
vote
1answer
27 views

How to pass a php array to javascript array/object with non-sequential keys

I'm trying to pass a php array to javascript, but the array has non-sequential keys. Here is a portion of the array: Array ( [1812] => Array ( [RecID] => 1 [...
1
vote
2answers
2k views

“0 Class 'JToolbarHelper' not found” error while trying to login to the backend

I am trying to login to the backend of my Joomla installation and have this error: 0 Class 'JToolbarHelper' not found I'm not sure how to fix it. I updated the tmp directory in the server setting ...
1
vote
2answers
282 views

jQuery global array showing as undefined

I have set a couple of global variables on page load as follows: jQuery(document).ready(function() { console.log("Onload PHP vis_options:"+JSON.stringify(<?php echo json_encode($...
0
votes
0answers
139 views

Adding li to ul causes all li to end up outside the ul

I have a page that has the following uls on it: <div id="team1" class="team_name">Desperate Housewives <ul class="sortable ui-sortable" id="sortable_1" ...
1
vote
0answers
48 views

Echo PHP output in a slider effect

I'm fetching data using for loop and echo results on a page. How do I output the results in a slider effect? I have tried a simple CSS slider but can't get the intended result. What I end up getting ...
8
votes
1answer
3k views

How to manage language variables inside JavaScript?

In my custom component I do a lot of JavaScript validation for each view. The validation throws various error messages and those messages are configured inside the language file en-GB.com_mycomp.ini ...

1
2 3 4 5