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
0answers
28 views

Custom JS Module and Image Src Broken

I'm using HD-AnyCode to insert come custom JS in a module, i'm then displaying this module in a Joomshaper template. The custom JS is basically calling an external API and returning data, i'm then ...
1
vote
2answers
32 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
17 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
46 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
40 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
21 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
50 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
71 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
31 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
53 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
130 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
81 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
169 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
105 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
34 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
285 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
193 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
967 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
209 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
36 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
187 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
172 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
189 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
48 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
48 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
118 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
102 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
725 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
761 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
1k 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
567 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
346 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
81 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
147 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 ...
2
votes
1answer
640 views

custom table display - help turning static html to dynamic php

I am trying to modify the list view of my Joomla component to display my table's data in a more user-friendly fashion. It currently simply displays all data in a regular table with columns and rows, ...
3
votes
1answer
671 views

Send array from javascript to php by POST in Joomla 3.x

im trying to send an array from javascript to Joomla 3.x php file. var options = ['foo', 'bar']; $.post('index.php?option=component&view=componentview&Itemid=123&tmpl=component&...
1
vote
1answer
151 views

render/execute jasvscript code (which is in a php string) inside virtuemart JDispatcher eg: plgVmConfirmedOrder

I want to render/execute some javascript code written inside virtuemart JDispatcher eg: plgVmConfirmedOrder eg: $script='console.log("this is dummy script");jQuery.ajax({url:'',type:'post',success:...
4
votes
2answers
800 views

how to display message in joomla using javascript

I want to display a message after clicking a button in Joomla using: Joomla.renderMessages({"success":"this is test message"}); but it displays the characters vertically and in descending order, ...
1
vote
2answers
322 views

How do I implement Google Analytics userID feature in Joomla 2.5 for logged in users with PHP?

My Joomla template includes the analyticstracking.php file with the tracking script, which has worked great, however I'd like to implement Google Analytic's userID feature (for cross-device tracking) ...
1
vote
1answer
156 views

RSform- scroll screen up when posting from one form to another

I have a form built with RSForm pro on my website home page and when user submit that, it redirects them to a second form (booking form) and auto populate the fields selected on first form. Im ...
1
vote
0answers
255 views

RSForms - Change the items of a radio group based on a selection of a drop down

I need to change the items of a radio group based on a drop-down selection in RSForm pro. Right now I'm using the Conditional Fields feature to show different radio group field and that caused too ...
1
vote
2answers
195 views

best way to add third party js and css

I need to add a third party js and CSS to my template head. I'm getting Leverage browser caching and someone advised me to load the files locally. created a directory in root: assets/third-party/ ...
1
vote
1answer
1k views

Run External PHP File From Joomla Article

I have a php file that will echo results in the end of the file. I want to from an onclick event fire some Javascript that will call this php file and print the results on screen. My javascript ...
1
vote
1answer
48 views

Run Code From Joomla Article

Is it possible to run JQuery or JavaScript in a Joomla Article? I ask because I have tried just about every possible option I see on forums/interwebs and the data does not display as I desire.
2
votes
1answer
485 views

Template Modal Conflict

Joomla 3.6.5 Joomshaper Helix 3 Template link FavimageHover Module link I have the FavimageHover module installed on my site, it works great until I try and add images via the front-end. There seems ...