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
7
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
vote
2answers
344 views

JS loaded from template won't run inside custom component

I created a module position at my template where I load a custom module which is a menu bar. with the next script I change its position to fixed if someone scrolls more than 200px so that the bar ...
2
votes
1answer
913 views

How to call jQuery in joomla on specific script

I' m trying to use jQuery contextMenu within a joomla 3 site. The basic jquery code for the menu is: $(function() { $.contextMenu({ selector: '.context-menu-one', callback: ...
2
votes
1answer
388 views

JavaScript file not loading before dom

I'm trying to get slick carousel to work on my Joomla 3.4. I did this on a test page without having Joomla and it worked fine! I tried everything! the problem seems like the script is loading before ...
0
votes
1answer
462 views

Get external javascript file to work in joomla

I have a menu using IFrame Wrapper so that I can link to my own coded php page. Inside the php file is just listing down the data on table and I have search box so that user can filter the data ...
0
votes
1answer
282 views

How to implement this php code?

So I have this php code in my joomla site (joomla's latest article module) and id I'd like to add a bootstrap tooltip to the title of my links. Can someone point me in the right direction as to how i ...
2
votes
2answers
994 views

Change Element Background During Scroll

Trying to get this script to work on this site: var t = $('#preschool-program').offset().top - 120; jQuery(document).scroll(function(){ if($(this).scrollTop() > t) { $('...
1
vote
1answer
329 views

Adding defer to optimized javascript in T3 Framework

I am using T3 Framework as a template for Joomla. In it's options there are options for optimizing Javascript and CSS. If set to ON the framework minifies and joins Javascript to 1 or 2 files that are ...
0
votes
1answer
1k views

TypeError: jQuery(…).slicebox is not a function

Ok so I'm trying to use slicebox on my website and I can't get it work. It gets loaded, I mean the module is there, the script goes into the page but nothing is really shown. If I don't load it's ...
3
votes
2answers
3k views

Email address being protected from spambots

I've only noticed this issue on one of my sites. I recently upgraded it from 2.5 to 3.4 On certain (k2 contact) pages where there is an email address displayed I am seeing this right beside the email;...
0
votes
1answer
215 views

Mobile menu not working

I have got caching turned on for this website: http://storm.agency/ But I am not caching the nav module, also cleared any cache but the mobile menu is not dropping down when viewing the site on a ...
-2
votes
2answers
358 views

How to access the email of the user who created a submission?

I have the following working javascript code: var user_email = document.getElementById("jform_user_email"); user_email.value = "<?php echo JFactory::getUser()->email; ?>"; The next lines ...
1
vote
2answers
54 views

Updating component's main window when clicking on sidebar

I'm developing a component that will work as an explorer for Joomla, with a treeview on the sidebar and a list of elements on my component's main window . What I don't know how to do is, when clicking ...
2
votes
1answer
328 views

CSS/JS compression distorts the website template/look

My website has a score of 50/100 on pagespeed. I am trying to improve it's load speed. When i implement compression either via template (T3 template option)or JCH plugin the website completely looses ...
5
votes
3answers
1k views

Load javascript script before </body> closing tag

I'm using $doc->addScript($path.'/js/script.js'); to load a Javascript file inside the head section. Is there any native way to load it in the bottom of the page, before the closing </body> ...
3
votes
2answers
447 views

Save Dynamic Array of textboxes

I have developed a code to create dynamic textboxes on click of "Add" button using javascript - Javascript function GetDynamicTextBox(value,index) { return '<input type="text" name="...
1
vote
1answer
903 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
1answer
72 views

Detect position of loading Javascript libraries in Joomla frontend?

Is there a way to detect position of loading javascript libraries in Joomla(my goal is 'framework.bootstrap'). because I currently follow this post but after using "unset" method from [JDataset][2] ...
0
votes
0answers
122 views

Joomla Contact Enhanced required field jquery

I am using joomla contact enhanced form component for my site. Now when I submit the form without the required field, the page is not scrolling back to the top rather it's stuck in the bottom section ...
2
votes
1answer
1k views

Stop Joomla! 3.4.1 from including scripts in custom component pages [duplicate]

I'm trying to prevent Joomla! 3.4.1 from loading certain default scripts in the front-end template when a custom component is displayed. I am excluding the scripts in the template index.php file as ...
2
votes
1answer
1k views

How can two libraries avoid loading the same Javascript library twice?

Let's say my extension makes use of a popular JQuery plugin. I can include the Javascript file in my extension and link to it using JHtml::script or another method. The trouble is that for all I know,...
1
vote
3answers
1k views

How do I use Javascript to find the baseurl, add some other parts of a url and open in a new page?

I'm using Joomla 3 and want to use Javascript to find the base url of the page, extend this url with some other bits and send a variable through the url. Then open this page in the same window. ...
0
votes
0answers
555 views

How do I make a system message appear with Javascript with the right CSS?

I would like to make a system message appear using Javascript. I have used the following code so far to make the system message appear: var jmsgs = ['Deletion cancelled - no records deleted.']; ...
1
vote
1answer
43 views

ReferenceError: 'getMainImage' is not defined but it is

There is a problem with this page: http://www.pubsaregreat.co.uk/culture?category=18&view=pubs It is not showing images or the Google map, I've debugged it in the Console and it is showing: ...
3
votes
1answer
2k views

How to detect the current site/frontend language within Javascript

I want to detect the current site/frontend language within Javascript. How can I do to register the language for use within?
1
vote
2answers
358 views

Click login button programmatically

For testing purposes on joomla default login file here: (/templates/theme718/html/com_users/login/default_login.php), I run the following successfully to generate the username and change the language ...
1
vote
1answer
386 views

Defer mootools-more.js jquery.min.js

When I Defer mootools-more.js jquery.min.js in joomla i start to get errors from javascript. Is there a way to add something to a javascript that after defer the script work normaly? I know there is ...
1
vote
3answers
197 views

Joomla component include JavaScript, pop error

I'm new in Joomla, I have try to build my Joomla component, however, when I try to include Jquery ptTimeSelect library into front end it shows javascript error Uncaught TypeError: Cannot read ...
4
votes
2answers
457 views

How to load a page with a System Message

How can I load a page with a system message? Specifically I have a link and I would like that when a user clicks on the link it opens a specific page with a system message I pass it. I can see ...
0
votes
2answers
461 views

How can I add the typed.js plugin into a joomla module

I really love the typed.js plugin which can be found here(http://www.mattboldt.com/demos/typed-js/). I really want to use it on the front page of a joomla webpage I am building. However, I have been ...
1
vote
1answer
249 views

Click button and select menu programmatically

This question is based on previous question here where I managed to populate username from the opener/source to the destination window, using the following code in the destination window using ...
1
vote
1answer
810 views

Adding Data-Attribute value to XML field does not work

I have a form with dynamic fields. some items contain this input fields, some don't. Here is my code for the XML : $field = '<field name="id_'.$filter_record['id'].'_from" type="text" ...
0
votes
1answer
1k views

Adding a timepicker to a datepicker

Has anybody used a time picker in this link? http://trentrichardson.com/examples/timepicker/ I have already followed the steps in the link, I added the add-on.js file to my component and the css ...
1
vote
2answers
1k views

Login to Joomla website from mobile App

Background I have Joomla website and mobile App that's running on different server (programmed using JavaScript). Both belong to the same party, and the users have similar accounts on both with ...
1
vote
2answers
182 views

Removing script tags from variable values

I have a variable containing javascript code which looks like this: $this->item->test_script = '<script type = "text/javascript">code for url</script>' However when I view it in ...
2
votes
2answers
2k views

Limiting Values for Calendar DatePicker

Has anybody tried manipulating the DatePicker in Joomla? For example, In my datepicker, I am only able to select the date not greater than or equal than the current date, or from the datepicker, based ...
5
votes
2answers
842 views

Get access to php variable in Joomlas addscriptdeclaration for Javascript

How do I get access to php variables in Joomlas approach to integrate Javascripts with addScriptDeclaration? $document = JFactory::getDocument(); $variable = "test"; $document->...
0
votes
2answers
362 views

Where can I find piwik JavaScript code

I have installed piwik in my Joomla page using nfrPiwik plugin in order to insert the JavaScript code in order to interact my Joomla page with piwik statistics. However where can I find this code? ...
0
votes
0answers
467 views

How to disable fields in a fieldset?

I am using this code to disable fields in the form based from what I have searched in stackoverflow: jQuery('#reportFilters').children(':input').prop("disabled", "disabled"); But it does not work. ...
2
votes
1answer
131 views

Designing selectbox in joomla

I have a selectbox in which options are coming from a module. Following is its code. <div id="dropdown"> <form action="" method="post" name="country"><label for="country"></label&...
0
votes
4answers
2k views

About jquery and $document->addScriptDeclaration($js) by developing a plugin

I seem to be having an issue when using jQuery in my plugin, which results in a blank page. When I delete the last line $document->addScriptDeclaration($js);, the site display but the code doesn't ...
1
vote
3answers
162 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: $...
1
vote
1answer
459 views

Joomla 3 - Print/Send icons not showing

I recently upgraded a 2.5 Joomla installation to the latest Joomla 3. Everything went pretty well but one error exists that I cannot solve: All the articles show a small gear in the top right corner ...
0
votes
1answer
66 views

*.obj file extension is filtered in Joomla 3.x and browser [closed]

It seems that Joomla is set by default to filter the some of the files with different file extensions. Physically the file in question with *.obj(Wavefront) extension exist on server side but I can ...
3
votes
4answers
3k views

Dynamic JS and CSS combining without JCH Optimize

I know JCH Optimize is a very good plugin to compress and minify JS and CSS files but I noticed it also adds time to the page to be rendered. For example, WITHOUT JCH OPTIMIZE my TTFB is 200ms but ...
1
vote
2answers
517 views

XMLHttpRequest and Joomla global variables

I have a system Joomla 3.x plugin with a restore its settings option. For this I use XMLHttpRequest to load a backup file. No problem this side. The problem is in the php file used to update the ...
2
votes
2answers
389 views

Dropdown Value not loading on page's first load

I have a dropdown which has a value saved from the database. The problem is, when I go to the page to view the values it returns to the default. Here are my screenshots: On my 1st image, it displays ...
0
votes
1answer
875 views

Disabling a dropdown list

First of all, I posted this in Joomla Stackexchange because I have created a simple html file and the disabling of the dropdown works. I have this javascript code right here: function disable() { ...
1
vote
1answer
184 views

Configuration of open web analytics locally

I try to run the openwebanalytics software locally under wampserver and joomla using the instructions of this video. I have created the db. I have insert the owa file under the joomla site. I type ...
1
vote
1answer
576 views

Open Web Analytics in Joomla

How can I run Open Web Analytics software through Joomla? Is there any plugin? For example in order to run piwik through Joomla you can use the plugin named nfrPiwik.