Stack Exchange Network

Stack Exchange network consists of 174 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.

2
votes
2answers
20 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
219 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
55 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
10 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
0answers
6 views

Joomla -> JEvents Calendar -> Override Submit Button of edit form

I am using Joomla 3.8 with JEvents v3.4.47. The page where you can edit the calendar entry contains a joomla submit button: <button onclick="Joomla.submitbutton('icalrepeat.save');" class="btn ...
0
votes
0answers
27 views

Question about adding custom javascript to template

I´m working in a Joomla! Template and am wondering: Why the javascript in the site doesn´t work if the file is inside a folder in the root folder of the template ? Why only works if the javascript ...
0
votes
1answer
26 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
42 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
122 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
109 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
64 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
42 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
39 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
93 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
62 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
1answer
339 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
538 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
3answers
669 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
335 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 ...
0
votes
0answers
138 views

Animated change logo size on scroll script creates a library conflict or some other loading issue

I'd like to have the logo shrink when the page scrolls down and expand to original when the page scrolls to the top. Except for the preloader with rotating icon, my code prevents the page from loading ...
1
vote
1answer
191 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"' $...
0
votes
0answers
82 views

addScript breaking frontend editing

I have a piece of code in a component that I am building that loads maps in a tab in the admin view. The code works perfectly on the admin side, but when I attempt to add frontend editing, it's ...
-2
votes
1answer
30 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
63 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
44 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
92 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
530 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, ...
2
votes
1answer
454 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
128 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
453 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
265 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
134 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
188 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
150 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
43 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
367 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
2k 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
5answers
571 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
332 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
190 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
760 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?
0
votes
0answers
26 views

One page overwrite my jquery

I have one problem with my Joomla site, I have the site in 7 language, for all of them I have done a file form.php where I have submit form for customers to contact me and this file is in all 7 ...
1
vote
0answers
39 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
200 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 = {...
0
votes
1answer
110 views

page reloads when using document.getElementById

Im using the js function shown below to make a part of page disappear when user clicks on the button. but when i click on the button, the part disappears, but page reloads. why is it like this? <...
1
vote
2answers
78 views

Easiest way to make a dynamic 'assessor' or 'quiz'

I was working on a Joomla website with mainly HTML + CSS. I'm learning Java, but have barely any experience in JavaScript, though when reading the code I can eventually understand it. All I wanted ...
0
votes
1answer
49 views

ReferenceError: openMyModalNew is not defined error in Ijoomla Guru 5 [closed]

Little time ago I install Ijoomla Guru 5 and only now I realize that tutorials not opening in modal window. I get error ReferenceError: openMyModalNew is not defined. As right now I haven't access to ...
1
vote
2answers
342 views

Add <script> tag before </body> on only certain pages?

I am fairly new to Joomla (using for less than a year) and I need to find a way to place a script tag before the tag in joomla. This is for marketing (call tracking) purposes. I have seen some ...