Questions tagged [ajax]

AJAX (Asynchronous JavaScript and XML) is a technique for creating seamless interactive websites via asynchronous data exchange between client and server. AJAX facilitates communication with the server or partial page updates without a traditional page refresh.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

How to add File upload in the Gift Message form

I am trying to Add image upload in the Gift Message. To achieve , created a Field: image_url in the Table: gift message using db_schema.xml and used the extension_attributes.xml to set and retrieve ...
0 votes
0 answers
30 views

A technical problem with the server created an error. Try again to continue what you were doing in firefox browser?

I am facing this issue in magento ,i am getting this issue only in firefox please check below image. please help me how can i solve it ? is there any ajax issues ? Getting this type error /mui/index/...
  • 33
0 votes
2 answers
45 views

What is wrong in my ajax url?

I have written the following code the js $.ajax({ showLoader: true, cache: false, url: url.build('multiplecustomer/account/Logout'), type: "POST", }).done(function (data) { ...
0 votes
1 answer
27 views

what is the correct way to add ajax url?

My controller file is Vendor/MultipleCustomerAccount/Controller/Account/LogoutPost.php what should be the ajax url?
0 votes
1 answer
13 views

Magento 2.4.4 Change shipping method when cart value changes by adding quantity

I am having a bit of a issue figuring out the correct method to implement this. I am using OneStepCheckout on my site with free delivery for minimum cart value. When customers add product to their ...
  • 11
1 vote
0 answers
8 views

I have to add loader inside return pickupLocationsService (till get result from server side)

/** Copyright © Magento, Inc. All rights reserved. See COPYING.txt for license details. */ define([ 'jquery', 'underscore', 'uiComponent', 'uiRegistry', 'Magento_Ui/js/modal/modal', '...
  • 35
0 votes
1 answer
26 views

Send Custom Data to Controller

I am new to magento 2. I want to send the day and time option selected by user at checkout to my Controller. When the user selects a day and time slot from the dropdown, it gets the value but I do not ...
0 votes
2 answers
43 views

Magento2 Jquery Post Form via Ajax

I have a basic html form and what I want is when clicking the submit button to use Jquery and Ajax to post the contents to an external url instead of reloading the entire page. However whats happening ...
  • 793
0 votes
0 answers
23 views

Magento2 Owl Carousel

I am adding the slides in owl carousel dyamically but It is not working fine when I try to remove them some of the properties of owl carousel won't work at all like margin, lazload nav etc , although ...
0 votes
1 answer
16 views

messages disappear too fast when updating quantities via an ajax request

I'm trying to update quantities in the shopping cart in Magento 2.3.2 via an ajax request but I'm confused about the error messages. In my code after the ajax request has completed I execute the ...
  • 531
0 votes
0 answers
10 views

why do I get these numbers rendered in the front end? when I use ajax to do a get to an api

my pokemon-component.js define([ "jquery" ], function ($) { "use strict"; return { getPokemonResults: function () { /** * Return result from pokeapi *...
  • 1
0 votes
2 answers
487 views

Magento 2: Open Popup Modal on Button Click in Admin Grid

UPDATED I'm using Magento 2.4, I want to open a popup modal to display some info, currently, when I hit the button I am redirected to phtml file but I want to open a popup on the same page. I have a ...
0 votes
1 answer
27 views

its my html form I have used Ajax in it. now I need to clear the data in the form after submitting it by pressing the submit button

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> &...
0 votes
1 answer
254 views

Uncaught SyntaxError: Unexpected token < in JSON at position 0

Magento2 Error Uncaught SyntaxError: Unexpected token < in JSON at position 0 in the Ajax response $.get(url, function(data) { $('#load-more-loader').hide(); $('#load-more-product').show(); var ...
  • 3,466
0 votes
0 answers
10 views

How to run a JS code as soon as a user logs in through checkout. Magento 1.9

Guys I need to run a code as soon as a user logs in through checkout. But I'm not getting it, precisely because it sends a request to "/customer/account/loginPost/" and the return is a ...
  • 197
0 votes
0 answers
30 views

How to add add to cart with ajax to custom phtml

I have to add add to cart button on homepage. I have custom phtml in my own module. I would like this button to work with ajax. Could someone please suggest something?
  • 27
0 votes
0 answers
17 views

AJAX request processing forgot password form

I built another form where a customer can reset via ajax their password. The action form contains the "customer/account/forgotpasswordpost/" while the js is built $.ajax({ url: ...
0 votes
2 answers
48 views

Field number validation

I need to validate a field in a custom form. The field should be not required, and should validate if the content entered in it are numbers. I added the validation on the form which works. What does ...
  • 27
0 votes
2 answers
17 views

Can't load any data in backend

I've a (random ?) <pre> added in the end of the default json rendering content in backend (for users, products...). I'm sure I didn't touch anything from this part of the website, any ideas ?
0 votes
0 answers
33 views

AJAX increment decrement buttons in category page

I need to add +/- buttons for quantity on the category page using AJAX, which I only found for the cart page. Please help!
0 votes
0 answers
21 views

How do I set Listing UI Components to be loaded before rendering - as with ->setIsAjax(false) for Grids?

In some situations it's helpful to have grids load with the initial content, rather than via AJAX. In M1 (or M2 with Grids) setIsAjax(false) can be used, what is the equivalent for a Listing UI ...
  • 13
0 votes
0 answers
37 views

Change toolbar-amount items dynamically on load more magento 2.4.3.p1

Friends, I want to change the values of toolbar items on the click of the load more button and also click on pager so can anyone have an idea then please share with me. Thank you in advance. Please ...
0 votes
1 answer
50 views

Load More Produtcs Ajax functionality in magento 2

I want to add Ajax functionality for Loading Products on catalog page. https://prnt.sc/TbgsghHe-gVz I have added the button on the first page . Can anybody help me with the script plz. I want to make ...
0 votes
0 answers
219 views

Ajax Page Reload Not working

am trying to reload the page when on ajax success, but its not working below is my code. <?php /** * @var \Pramod\Custom\Block\System\Config\Exportproduct $block */ ?> <script> ...
  • 1,712
0 votes
0 answers
43 views

Actions via Ajax on UI Component listing

I'm adding some custom data to products, namely fixed quantities. These are to appear on the product edit page under a Quantities "tab". I'm using UI Components not blocks. After a great ...
0 votes
1 answer
61 views

Magento 2: Create Dynamic Category Dropdowns on Frontend

I, once again, have to ask for your help. I need to create a modal that let the customer select their car brand, model and year, and I need to populate the select options depending on the selections ...
0 votes
0 answers
223 views

401 unauthorized on sign in after creating customer via REST API

I am having some issues with creating new customers using rest api in magento 2.4 First I sign in with admin and get the token to be used later. Than I register new account using ajax: type: "...
  • 143
0 votes
0 answers
143 views

How can I pass custom form data and load result page using Ajax?

New to Magento. My goal with this is to have customer pick price range and sort order from a custom form I created, then when form is submitted have Ajax pass the form data AND load the new page with ...
0 votes
1 answer
304 views

Emoji is saving as (???????) in the database Magento 2

I added the Emojo library including JS and CSS files. Then it starts to display on the frontend. When I send the Emoji character via ajax. I am getting Emoji in the param request so while saving the ...
0 votes
1 answer
43 views

Add pagination in custom module by ajax call

I have developed Custom module in which data retrieving from db perfectly, but i want to show first ten data(10 rows) at first page and at second page display next ten data and so on by Ajax call.
0 votes
1 answer
415 views

Adding Dynamic Ui Components on select value change

I have a modal where I put a select ui component. I want than when the value of that select is changed I send an Ajax request to one of my controllers search in database an get a json response wich ...
  • 1
1 vote
2 answers
117 views

Ajax api call doesn't works using onclick returns error 400

So I'm trying to do an API call using Ajax on the Admin page, when I add this API call in onclick attribute, it doesn't work it returns error 400 Bad request, BUT when the API call isn't vinculated at ...
0 votes
0 answers
102 views

Magento 2 - Submit form to current page

I'm trying to launch a form with an action pointing to the same page. The form can be found on the details page of the customer's order: www.mysite.com/sales/order/view/order_id/255/ This is my code ...
  • 327
1 vote
1 answer
111 views

Ajax api call returning Bad Request decoding error

I'm trying to do an ajax API call on the admin page, but it returns a Decoding error: \nUnable to unserialize value. Error: Syntax error... $('#button').on('click', function(){ $.ajax({ ...
1 vote
2 answers
349 views

Api call using ajax on admin page returns invalid form key

i'm trying to do an api call using ajax on admin page, but it keeps returning "Invalid form key" <script type="text/javascript"> require([ "jquery" ], function (...
0 votes
0 answers
19 views

How do I add javascript code to handle callback events after submission of coupon register?

I am using Magento 2.3.5-p2 I am required to trigger a javascript code as below once a user has successfully registered their coupon dataLayer.push({ 'event': 'trackEvent', 'eventDetails.category': '...
0 votes
1 answer
182 views

Magento 2 - Direct download external file

In Magento 2, I try to force download a pdf file from an external link (I don't have the source file). All I succeed is opening the file in the new browser tab but the direct download doesn't work. Do ...
  • 107
0 votes
0 answers
27 views

Menu tree via JSON and AJAX

I want to populate TOP Menu later via AJAX Is there some code available that can get this done. Or a code that will generate the needed JSON and then we will take this JSON as a response and ...
0 votes
0 answers
266 views

The requested URL was rejected while trying to save the address book using special characters

Steps to Reproduce: Go to the storefront Log in as a customer Go to My Account Now go to Address Book and click on add new address button Fill the address form ( add special characters in mandatory ...
0 votes
1 answer
33 views

How to show a popup when the checkbox is ticked in Magento using ajax

Just needed to add a popup modal when the checkbox is ticked and post the values to the controller.
0 votes
1 answer
112 views

Magento 2.4.3 - Reload totals cart after ajax change quantity - shipping costs error

I use this code to reload cart with ajax after quantity changing - $.ajax({ url: form.attr('action'), data: form.serialize(), showLoader: true, success: ...
  • 317
0 votes
1 answer
358 views

How to set data into session with ajax magento 2

How to set data into the session with ajax Magento 2, I want to store price into the session with ajax for when the site is refreshed price gets from the session, not from the database.
  • 65
0 votes
1 answer
80 views

How to add product price to session with AJAX Magento 2

How to add the product price to session with AJAX Magento 2. Please give me an example of the custom module of this solution.
  • 65
0 votes
1 answer
14 views

Use AJAX and get the values of text from the Admin Panel

I want to get the values from store->configuration. And print that value in the PDP page using AJAX. The value should be refresh all the time using AJAX.
0 votes
0 answers
237 views

The Content-Security-Policy directive 'frame-ancestors' does not support the source expression ''unsafe-inline''

i am using magento 2.4.x and i want to send data from ajax to controller but i cant do that , the compiler doesn't enter to the controller class , is this because i have this error on my console on ...
  • 109
0 votes
1 answer
49 views

Magento 2 : What is Purpose of Custom Varnish Synthetic Rule For Customer Ajax Login?

I have a situation where customer ajax login is not working even though the customer submits valid credentials. Instead, the page reloads and the customer is not logged in. To clarify, it DOES work ...
  • 1,109
0 votes
2 answers
46 views

How to run ajax in certain time interval in Magento2

I have added ajax to show a text which is fetched from my scope config(The value is given in the store->configuration). In my controller I am getting the value using scope config and used echo in ...
0 votes
2 answers
212 views

can't send data from ajax to controller

in my case I have a controller and an Ajax data sending, but when I check the code the AJAX doesn't send anything and Magento doesn't enter to my controller, is it a problem of routing or what, this ...
  • 109
0 votes
1 answer
38 views

Change minisearch bar input width on hover

I am trying to change the search bar input width when it expands on hover. <div class="search-wrapper"> <div class="search-content block block-search" id="search-...
0 votes
1 answer
60 views

How to force reviews to appear on page load? trigger processReviews

I'm trying to make customer reviews appear on the PDP page without clicking on the reviews button. On reviews tab click, ajax request is being sent to the server and I want to send this request on ...
  • 11

1
2 3 4 5
16