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
2
votes
1answer
51 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
0answers
17 views

AJAX GET token 'x-csrf-token' not present in the CORS header Access-Control-Allow-Headers AND CORS request did not succeed

I'm loading a module in SP Page Builder, this module gets data from an API using ajax. The module has been tested on local and remote, http and https. When I publish the module on the same website but ...
0
votes
1answer
34 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 ...
0
votes
0answers
10 views

Why am I getting an editors iframe popup in tiny mce editor when I embed a canva button in it

I am trying to embed a canva button in tinymce editor. Everything works fine. The canva url get loaded in a iframe but at the same time an iframe is also loaded in the back with the home url. How to ...
1
vote
1answer
16 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
56 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
45 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
13 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
76 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
32 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
31 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
30 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 ...
1
vote
2answers
39 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
67 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 ...
2
votes
1answer
48 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', ...
2
votes
1answer
55 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....
1
vote
1answer
23 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 [...
0
votes
0answers
20 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 ...
0
votes
0answers
95 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
2answers
89 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($...
1
vote
0answers
35 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 ...
1
vote
1answer
58 views

iFrame with javascript

I would like to summarize my problem: I need to obscure the source of the iframe from the source code. To do this I have to use javascript code and obfuscator. By inserting the following obfuscated ...
1
vote
2answers
227 views

Client side validation - custom event handler not called when user enters the field and leaves it being empty

I'm working on a JForm with some fields with custom event handlers to do client side form validation as it is described in this document The document says that "Joomla adds a blur handler to validate ...
0
votes
1answer
187 views

How to submit JForm form based on custom dropdown list value change

I'm working on a custom Joomla module. I have a JForm that contains multiple custom dropdown lists based on JFormFieldList. The form should be submitted when a value is selected from one of the custom ...
2
votes
1answer
385 views

Lazy loading script doesn't run after AJAX load

Issue related to Video lazy loading skipping first video in every list The css shows up with a black box and the arrow, but script doesn't seem to run after ajax load from pagination, and also when ...
0
votes
1answer
112 views

Video lazy loading skipping first video in every list

I'm using code found here: https://codepad.co/snippet/CtLEQDKX to lazy load the preview image for youtube videos within JComments. I have it working pretty good and looking like I want it to and it ...
2
votes
2answers
39 views

My Joomla Template is loading my custom CSS using JS. Is there a way to add the unique version tag to my custom CSS? i.e: custom.css?20180101

I normally just add my unique tag to the css path in the section of my html, but my template is adding my custom CSS via Javascript: if (is_file(T3_TEMPLATE_PATH . '/css/custom.css')) { $this->...
3
votes
3answers
401 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 ...
2
votes
2answers
474 views

How to include scripts in <head>

Ok I am having a hard time with this one. I just inherited a 3.8.x Joomla site and all I'm trying to do is include a GTM script in the head of the document. What's happening is that anything within ...
1
vote
2answers
1k 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
267 views

How to build valid json object for a component's ajax response?

I've set up an Ajax call in my component. I seem to have got the initial call, the controller, the data model is working because when I make the JavaScript call I'm showing this in the code inspector ...
1
vote
1answer
14 views

Targeting An Element On a Specific URL

I need to run an alternate header on a single top-level Joomla page. From what I can see, unlike Wordpress Joomla doesn't assign an ID to individual pages, making this a pain. I'm wondering if I can ...
0
votes
1answer
38 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 ...
2
votes
1answer
34 views

Make div disapear after a while

I have made a page, where if the user update its form, the backend will send the user back to the form with a message like this: header('loaction:/index.php?msg'); On the index.php site, it loads ...
0
votes
1answer
233 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 ...
0
votes
1answer
254 views

CSS files and Js files not loading in https

Recently I try add https to a Joomla site. In https everything was ok, now it’s not loading some CSS files and Js files. Using the network tab in chrome dev tools I get the following error: (failed) ...
1
vote
1answer
251 views

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

I'd like to know the 'currently' correct way to add JavaScript to the head of a page. The documentation suggests using $document->addStyleSheet($url);, but the API documentation says that this ...
1
vote
1answer
50 views

Cannot get variable to update in IF/Else statement based on page class

I am trying to dynamically update a variable in a link depending on the page class, but I cannot seem to get the variable ebox to update in the if/else statement below. At present the variable is ...
1
vote
1answer
61 views

Dynamically change ID of a href based on page class

I am looking to create an override of a component to add a button, however for each page that uses the override, I need the button to have a different ID as by clicking the button it will open a ...
0
votes
1answer
128 views

Trying to embed custom YouTube iFrame into Joomla module

I have some custom code which randomises a joomla video, this works fine outside of Joomla as can be seen at this fiddle, however when the code is placed into a Joomla custom module and published the ...
0
votes
1answer
136 views

Navigation link to div id does not behave correctly

What I'm doing I am currently working on my Menu. I have one Menu-Item which links to a <div> that I have given an <div id="foo"> I link to this id by using the external url option with ...
6
votes
2answers
918 views

Control order of loaded scripts

Unfortunatelly I can't register on the joomla forum, so I'll try my best here. Please help, is there any way to control the order of loaded scripts. Example: in my template's index.php I do: $...
2
votes
2answers
837 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
4answers
2k views

How can I insert js scripts before </body>

I know this question is been asked again, but i tried their solution and it doesn't work so please don't rate it down. I have an authentication script (auth.js) that needs to be placed before the tag,...
3
votes
1answer
670 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 ...
2
votes
1answer
386 views

How do I add “id” to script declaration

In the example below, the loaded script will appear in the 'head' with a plain 'script' tag but how do I add an id into the declaration so the result is something like 'script id="my-script"' $...
-2
votes
1answer
33 views

FutureProspect Theme How to deactivate the top toggling effect?

I am using the FutureProspect template on my Joomla website. The only issue what I am facing is the availability of the following effect, which is irritating on the mobile effect: Kindly let me ...
0
votes
1answer
89 views

How to insert tracking JS code (snippet) into Piwigo gallery?

Javascript code for tracking which was incorporated into Joomla installation through a Custom HTML module has no effect on Piwigo gallery. How visits to the gallery could be tracked, i.e. where the ...
1
vote
2answers
46 views

Test site not rendering template list php error

Okay, so we have a section of our server portioned off to be a nested test site. However for whatever reason the below template causes an error in Joomla's php handler that it does not on the active ...
0
votes
1answer
217 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 ...