Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
30 views

Custom script with Ajax script into Joomla

I am fairly new to Joomla. I'm trying to display the content of my custom made html page inside one of Joomla's menu. The page works fine on its own. however when I try to use Jumi and attach it to ...
1
vote
1answer
47 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 ...
2
votes
0answers
200 views

How do you get anchor links to work with pagination?

This is a problem I've had and been thinking about for awhile, and I haven't been able to find a topic that has helped. I have 2 different pagination codes, neither will go past page 1 with an anchor ...
1
vote
2answers
81 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
51 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
142 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
96 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
28 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
226 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
41 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
1answer
755 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
116 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
32 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
102 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
144 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) ...
0
votes
0answers
128 views

Cannot read property 'appendChild' of null when embedding JS game

Update 2: Ok, so I've realised that the 'css' was actually 'scss', after compiling it down everything is working as expected. Update: I have managed to get the cards to load, by moving the js file ...
1
vote
1answer
119 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
46 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
42 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
109 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
81 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
558 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
649 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
467 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
275 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
74 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
112 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
599 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
591 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
141 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
634 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
302 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
146 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
220 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
174 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
47 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
438 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 ...
1
vote
1answer
3k views

How to get the active language variable in javascript on a multilingual site?

So, I'm trying to modify the Facebook Devkit script that is in my index.php to change depending the on the website's active language, but I'm not sure how to access the active language variable. I ...
3
votes
6answers
691 views

What's the correct way of adding code after the start of the body tag?

So, I've just recently added the Facebook Javascript SDK to my site to be able to enable a "like" button to my pages. Facebook recommends adding this right after the opening <body> tag. The ...
0
votes
1answer
365 views

Using a JQuery function in a module?

I have customised a small text rotator using Jquery which I wish to use to rotate phones numbers in a module.It can be found here: http://jsfiddle.net/tovic/xaqgn/ I have tried embedding the function ...
4
votes
1answer
223 views

Where to call for CSS/JS in custom component for frontend views

I've created a custom component with a dashboard that needs styling with CSS. I've created the CSS file and I'm looking at calling for it in the frontend view. Working with J! 3.6.5 and a MVC ...
2
votes
1answer
921 views

Add script just after <head>

I'm registering to Google AdSense. In order to check the site they want that I put a piece of code inside (<script>something</script>) just after <head> tag. How can I do it?
1
vote
0answers
40 views

stop reloading the page when choosing a payment method in virtuemart checkout

on virtuemart checkout process, on choosing the payment method, when click on the radio button, page reloads. i have wrote a function that does something when page reloads or refreshes. but the ...
4
votes
1answer
233 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 = {...