Hot answers tagged

6 votes

Making an ajax-based template?

My advice to you - avoid this. It's a recipe for many problems. A website owner who wanted this ended up paying us a lot of money just to fix the problems that arose from using this strategy (there ...
itoctopus's user avatar
  • 3,226
6 votes
Accepted

How to get Ajax response within a Module?

For the ajax request to map to your module's helper the class must be named "modFilefinderHelper" From the documentation: Module requests must include the module variable in the URL, paired with ...
jamesgarrett's user avatar
  • 3,299
5 votes
Accepted

How to execute an ajax script to update form fields in an .xml file rendered by Akeeba FOF?

You can use JSON format in the controller directly by adding .json suffix and changing format in your URL to json. In this case the controller would be placed in /administrator/components/com_example/...
Sharky's user avatar
  • 11.1k
4 votes

Ajax error when attempting component updates

I recently encountered this XMLHttpRequest error myself. The root of the problem caused 3 different issues. SOLUTION: In my case, the problem was caused by an incorrect setting for the public $...
TryHarder's user avatar
  • 2,340
4 votes
Accepted

how to refresh Joomla token in form by AJAX

I wanted to answer your earlier question about this yesterday, but someone was already answered this partially for you. So according to me your original Login Form token field should be a bit changed ...
Zollie's user avatar
  • 2,926
4 votes

how to refresh Joomla token in form by AJAX

Playing with the sessions is usually not a very safe thing to do - you could create more problems by trying to find a solution. You can do one (or both) of the following: Increase the Session ...
itoctopus's user avatar
  • 3,226
4 votes
Accepted

How to get user object in Ajax call

When importing classes using use statement, it has to be outside of your class. When put inside a class, it's interpreted as a use of trait. And when used inside a method it will cause a syntax error. ...
Sharky's user avatar
  • 11.1k
4 votes

Adding ajax call in a module for Joomla 4

To use J4 style or custom naming conventions with AJAX you have to convert the module to new service-based format. At a minimum, service provider (services/provider.php) needs to provide a module ...
Sharky's user avatar
  • 11.1k
3 votes

AJAX post not able to update database

After more searches, I managed to work it out. Hopefully the below will offer some small mercy to some lost joomla soul like I was. The main challenge was constructing the URL and get a response. So ...
Phillip's user avatar
  • 61
3 votes
Accepted

Ajax multiple module instances

com_ajax dosent need to know correct instance of module, since it only needs to find helper.php (to call getAjax()), which is obviously same for both instances. So this covers your second question. ...
Rene Korss's user avatar
  • 3,208
3 votes
Accepted

Searching for users and tagging their name in a post

2) for sure. An Ajax query is a small load. It does not block and return the whole users table. You can have better control. For example, returning only 3 attempts. On the other hand 3) is a method ...
Anibal's user avatar
  • 7,435
3 votes

Making an ajax-based template?

Yes, there is a better solution... AddFullAjax is nice plugin which connects FullAjax library to Joomla site, and it may work pretty well for simple sites. Demo at http://getsite.org.ua/jdemo/ shows ...
Mikan's user avatar
  • 3,007
3 votes

What is the proper way to make an AJAX call in component?

You can access a controller directly by using the controller name in the task: index.php?option=com_similar&task=controller.abc&format=raw will call: controller.raw.php (return is raw) ...
Dennis Heiden's user avatar
3 votes

Sending POST data within module - AJAX

You should use Joomla`s com_ajax. The way to achieve your goal is: Change url to index.php?option=com_ajax&ignoreMessages&module=YMODULE&method=YMETHOD&format=json Also you need ...
Alexandr's user avatar
  • 1,130
3 votes
Accepted

Joomla Ajax Module getAjax() method not found

Your Helper Class name should be: ModDisplayVacanciesHelper And the Module must be published on all pages, if not you have to add one menu ID in your request where the module is published. Just like ...
Webdesigner's user avatar
3 votes

How to get Ajax response within a Module?

Ok first thing is first, get your Javascript out of the PHP file and into a separate .js file. The file should be placed in the media directory, but just for temporary measure, just place it in the ...
Lodder's user avatar
  • 26.9k
3 votes
Accepted

Reload admin form after save field in database

When you save the template with the JavaScript call saveTemplate(), you are sending an Ajax call to the server. This Ajax call is the one being redirected with a HTTP redirect. You are ignoring the ...
Javatasse's user avatar
  • 256
3 votes
Accepted

Run function in com_content with ajax - doesn't call it correctly

Apperently I was missing an important part. I needed to have the "loginUser" task addded to the switch in view.ajax.php like: function display($tpl = null) { $task = JRequest::getString('...
Jonas Borneland's user avatar
3 votes
Accepted

How to check JSESSION in javascript

One way I can imagine to check the session is before you ignite the above ajax call, you make a previous ajax call to another function in com_contract/controller(task = your new session checking ...
Zollie's user avatar
  • 2,926
3 votes
Accepted

AJAX post request not sending data

First, since you want to send just an extra key+value, then you can include that in the url of the ajax call like the following: url: '/my_site/index.php?option=com_j2store&view=callback&task=...
Zollie's user avatar
  • 2,926
3 votes

How to execute an ajax script to update form fields in an .xml file rendered by Akeeba FOF?

This component is developed using Akeeba FOF, so you need to read the documentation to know how to complete the task. Almost everything is configured using XML, this is to some extent of course. To ...
Mohamed Abdelaziz's user avatar
2 votes

Show Form Field if AJAX-response is false

Well you could attach your hide/show functions within the success parameter of the ajax method. var showMethod = function () { // show method code... } var hideMethod = function () { // hide ...
FFrewin's user avatar
  • 19.7k
2 votes
Accepted

Problems with ajax call in component

By default, each http request is independent. You have to send all parameters again in each call. Alternatively, if your client can keep session cookies, then you can store server-side variables in ...
Anibal's user avatar
  • 7,435
2 votes

Ajax error when attempting component updates

Typically this happens when you have an .htaccess rule (possibly originally inserted for additional security) blocking access to the restore.php file. We have written about this here. Having said ...
itoctopus's user avatar
  • 3,226
2 votes

Ajax error when attempting component updates

Update I had the issue again today, renaming the htaccess only without disabling Admin Tools and then updating worked for me. So it seems to have to do with the rules, set in the htaccess by Admin ...
Dennis Heiden's user avatar
2 votes
Accepted

Restricted direct access creates problems passing references between files

Use Joomla's AJAX interface... (JRequest was actually a unified mechanism for data filtering etc of post and get requests… Never use raw globals ($_POST, $_GET etc) you leave yourself open to security ...
Craig's user avatar
  • 1,759
2 votes

AJAX test module is not working. POST 404 error

Found the problem by myself. 'module' : 'mod_ajax_test', must be 'module' : 'ajax_test',
Striker8472's user avatar
2 votes

Using AJAX in a custom module - how to do it?

I don't understand why you are trying to bypass the framework. I know it is resources wise but it opens you up to security risks. The other thing is that you can't use framework classes/functions as ...
Artur Stępień's user avatar
2 votes
Accepted

Custom Module delete from database with AJAX

Security Before anything else - I want to draw your attention on this: You are sending to the database unfiltered input from the users with the $propertyId. No matter what other security may exist, ...
FFrewin's user avatar
  • 19.7k
2 votes

How to keep data in Joomla module helper class

I don't know a lot about static methods as I never work with them, however (and don't quote me on this), it may be because you cannot access non-static properties in a static function. So you'll ...
Lodder's user avatar
  • 26.9k

Only top scored, non community-wiki answers of a minimum length are eligible