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 ...
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 ...
5
votes
Accepted
Submitting a Form with file inputs via AJAX
I managed to make it work. Sharing the same which can help others.
No change on the form and controller. Slight changes on the model and ajax
model
public function uploadPicture() {
$input = ...
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/...
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 $...
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 ...
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 ...
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. ...
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)
...
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 ...
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.
...
3
votes
Accepted
Post data using com_ajax joomla 3
I am not sure about $input->get('data', '', 'array'). Are you sure that data var is being passed?
I think you can simply use $input->getString('username') and so on to retrieve parts of the ...
3
votes
Problem with JRoute::_ and ajax data
The final source code is:
// Get menu item
$app = JFactory::getApplication();
$menu = $app->getMenu();
// Get component's name
$comName = JFactory::getApplication()->input->get('option');
/...
3
votes
Accepted
Joomla AJAX request
Your component's name is com_nautilus. With Joomla MVC your controller is looking for a class called "nautilusViewDatalist" in the file view.raw.php but you named your class "SimilarViewDatalist". ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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('...
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 ...
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=...
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 ...
3
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 ...
2
votes
Joomla AJAX request
How to Implement Ajax in Joomla Component
Create Controller File Where you will send ajax request from javascript to PHP
controller.php
<?php
defined('_JEXEC') or die('Access Deny');
jimport('...
2
votes
Insert into database with ajax from a joomla 3 module
I've done something similar recently except i'm deleting from the database. I'm guessing you can modify the code to update instead.
This is the ajax call in default.php
<script>
function ...
2
votes
How does k2 calculate item view times
In K2, articles are represented by K2ModelItem (com_k2/models/item.php, line 892), where you can find:
function hit($id)
{
$row = JTable::getInstance('K2Item', 'Table');
$row->hit($id);
}
...
2
votes
Accepted
Loading the options of a select form field via jQuery Ajax
If I rightly remember, you need to update it if any dynamic changes are made.
You can do so with the following:
jQuery('#jform_student_ids').trigger("liszt:updated");
Hope this helps
2
votes
Accepted
JText language doesnt work inside external ajax file
After you're require_once calls, add the following to initialise the applications:
$mainframe = JFactory::getApplication('site');
$mainframe->initialise();
Then load the component's language file:...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
ajax × 151joomla-3.x × 64
jquery × 26
php × 22
module × 20
component × 17
javascript × 17
joomla-4.x × 11
joomla-api × 10
form × 10
custom-component × 9
development × 8
json × 7
plugin × 6
com-ajax × 5
joomla-2.5 × 4
joomla-3.4 × 4
user × 4
k2 × 4
jform × 4
custom-module × 4
model × 4
security-token × 4
articles × 3
mysql × 3