Questions tagged [jquery]

Denotes questions related to the use of jQuery library in Magento.

288 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
496 views

How to apply custom validation in Magento 2 checkout Shipping Address form?

In Magento2 - I want to apply some custom validation on shipping address form of Magento 2 Checkout. Normally I do it with JQuery but don't know how to apply it in Magento 2. The validation I want to ...
5
votes
0answers
126 views

Magento2 : How to create a basic progress bar with ajax, when I click on add to cart button?

I try to make a basic progress bar with ajax , when I click button add to cart, but I don't know how catch the xhr on console,to put on alert() or prepend()function I follow a video example in ...
5
votes
1answer
2k views

Magento 2.2.1 Checkout page broken and Js fail to load error

I have installed Magento 2.2.1 and set up my custom theme but checkout page looks broken and consoles showing errors: Not sure how to resolve this issue. Need help how can this be resolved. How ...
4
votes
0answers
128 views

Is it safe to disable JQMIGRATE?

Seems like it is complaining about using a deprecated pseudo-event. Also, If I remember correctly console.trace is used for debugging and should not be shown/needed on live site. The JQMIGATE code ...
4
votes
2answers
181 views

Menu that open by itself after clicking on the link of a parent category

When I click on parent category, the page load but the menu re-open if the pointer of the mouse is still present. What do you recommend so that the menu does not re-open immediately ? I found PHP of ...
4
votes
0answers
125 views

Knockout.js in magento2

How to change the jquery into ko? define([ 'jquery' ], function ($) { "use strict"; $.widget('xxx.homePage', { options: { bindSubmit: true, ...
4
votes
1answer
86 views

Magento2 - Remove/edit classes from navigation

I have set up a new magento2 store and I added some jqery-ui items ( accordion and tabs) and for them to work, I was included the jquery.css in my _extend.less inside my custom theme. Unfortunately ...
4
votes
1answer
191 views

Magento 2.1 : Calendar Frontend

I have some data on front-end , which I want to show on specific days in the calendar. I got this code to show the calendar on the front end . <?php $a = 'some text'; $b = 'some ...
3
votes
0answers
138 views

How to show all data in array using jquery. Magento 2

I'm getting all the Data from Array in Jquery when I console.log() it then it shows me all the data of the array but when I append the data with <div> then it only returns me the last value I ...
3
votes
1answer
118 views

make sticky header without custom js code

I tried to make the header sticky using the default jquery code: $('.page-header').mage('sticky', { container: '.page-wrapper' }); I added this piece of code into the theme.js file in the ...
3
votes
1answer
666 views

JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack()

JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack() error when first time lode the website after refreshing all ok every thing are working its in magento 2.2.6 please not provide solution ...
3
votes
0answers
625 views

Uncaught TypeError: $.initNamespaceStorage is not a function magento2

Some functionality is not working properly and it shows some errors in console Any help will be appreciated.
3
votes
0answers
1k views

mageInit KO binding not working for a custom jQuery widget

I can't get the mageInit binding to work on a custom jQuery widget which I have created. I have used it in my KO template like: <div data-bind="mageInit: {'mywidget':{'configuration-value':true}"&...
3
votes
0answers
121 views

Initialise a Jquery Widget on Demand with Jquery

I have loaded my layered navigation over ajax to speed up my site load. The layered navigation also uses ajax and it's jQuery is normally initialised via RequireJS i believe with the below requireJS ...
3
votes
1answer
590 views

Datatables jquery plugin in Magento 2?

Datatable version 1.10.15 requirejs-config.js var config = { paths:{ 'dataTables': 'df_Comercial/js/datatables.min', }, map: { '*': { 'dataTables': '...
3
votes
1answer
2k views

Using jquery in phtml got an error: Uncaught ReferenceError: require is not defined

I use jquery in my phtml frontend page like this: <script> require(['jquery', 'jquery/ui'], function($){ var currentUrl = '<?= $itemEditUrl ?>'; $('#link-cusom-campaign')....
3
votes
2answers
2k views

Inserting Javascript codes in one CMS page of Magento 2.1

I am trying to add some javascript codes in one CMS page of a Magento 2.1 site. Here are what I did and the issues I am facing now: 1)at the "Layout Update XML" of the page, add the following jquery ...
3
votes
1answer
1k views

Magento 2 jQuery Modal Not displaying in center

I'm new to Magento 2. For homepage popup i have added below code <div id="popup-modal"> Test Data </div> <script> require(['jquery', 'Magento_Ui/js/modal/modal'], ...
2
votes
0answers
20 views

Select country through Jquery in Origin Address of Shipping Settings

I am trying to set Country for Origin address using jQuery in Shipping Settings of Sales (Store Configuration). The issue is, on change of country option using jquery, the ajax to fetch region is not ...
2
votes
0answers
21 views

Magento 1.x - Ajax auto choose product

I want after I have pasted sku or name product into the input seach, it will automatically check and notify. I am currently using autoComplete jQuery. But the problem is that if it doesn't show drop ...
2
votes
0answers
80 views

Customize native loader

I would like to challenge the template structure of Magento 2 loader which is declared in the lib/web/mage/loader.js but I can't find where this widget is calling by Magento to override the javascript ...
2
votes
1answer
155 views

Magento 2.1.7 - Unable to send form data to controller using AJAX

I am trying to fetch input value but I am unable to get values in the controller. Here is my code, Controller\Index\Index.php <?php namespace Crud\Crudatfrontend\Controller\Index; class Index ...
2
votes
0answers
79 views

Magento-2 jquery widget timing issue

I recently started using jquery widgets in magento and come to know that magento extends jquery-ui widgets through the use of widget factory and customises them according to need and then again return ...
2
votes
0answers
201 views

jQuery got no function after AJAX call

I'm having a problem in using horizontal navigation. When I sort something, at I changes show products with ajax the navigation isn't functional anymore. The click function in jQuery is still working ...
2
votes
0answers
1k views

magento 2 Uncaught TypeError: Cannot read property 'version' of undefined

I got below error randomly in front-end and when all modal popup not working when below error occurs. Uncaught TypeError: Cannot read property 'version' of undefined I have override admin product-...
2
votes
1answer
467 views

Magento 2 TypeError Undefined products images not displaying / js not loading

At home page, product category view and product detailed view page images are not loading / displaying at firefox and less frequently at chrome. I am using magento 2.2.6 upgraded from 2.2.2 and porto ...
2
votes
0answers
36 views

Need to Initialization js while ajax response magento 2

Need to Initialization js for particular div when the div append ajax response magento 2. i have append the div in ajax response and also i need initialize js for that div. How to do that
2
votes
0answers
78 views

Custom popup in magento2

I have created a custom popup in list page .. I need to open the popup after 4 sec of every product addtocart. And auto close the popup after 4 sec. some time the popup suddenly closed within 4 sec.....
2
votes
0answers
804 views

Lazy load Js not working in Magento2.2.0/1/2 Version

I have https://www.magebees.com/lazy-load-images-extension-for-magento-2.html this one extension, but not working properly- js errors like window undefined..
2
votes
0answers
409 views

Add modal popup on multiple list elements

I would like to add modal functionality in a list of images wrapped in a div. It should work like so: when i click on a span element the next image should show in a modal. Html example below. <?...
2
votes
3answers
337 views

Whats the best way to remove Out of Stock text

I'm having trouble displaying the out of stock size without text "Out of Stock". Example: And here is how its showing up in DOM: <span class="option out-of-stock" value="370">25 (Out of ...
2
votes
0answers
892 views

How to update product quantity on check out page using Ajax in Magento

I want to provide functionality to update product quantity on checkout page of magento. so if user want to update the product quantity he can do it on without reloading checkout page. I want to ...
2
votes
1answer
1k views

Validation Error with jQuery-UI Autocomplete and KnockoutJs - Magento 2

The Problem: I've implemented jQuery-ui Autocomplete with Knockout Js in Checkout Page but some input fields that are binded to my Component throw a validation error ("Required Field") when i update ...
2
votes
0answers
455 views

Magento 2 QuickSearch widget

Does anyone have any experience with Magento 2 QuickSearch widget so perhaps they can provide a code sample (how to use it in module)? I have managed to include it to my js file, but i can not figure ...
2
votes
1answer
833 views

Magento 2 adding jquery in home page

I have added 'jquery-1.10.2.min.js' in app\code\Vendor\Module\view\frontend\web\js\default.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including ...
2
votes
2answers
759 views

Get customer chosen shipping method with jQuery

How could i find out the shipping method that the customer has chosen right after click of change? I have tried to get shipping methods id or value that customer has chosen when he/she has clicked ...
2
votes
1answer
1k views

Magento 2: Adding external CSS and JS to only one content page, and use jquery functions inside the content

I am trying to add some dynamic function to one content page of a Magento 2 site, but didn't manage to do it. Here is what I thought: 1) Adding the external javascript files at the "Layout Update XML"...
2
votes
0answers
598 views

Add full version of jquery mobile to magento2

Magento2 loads by default a custom build of jquery mobile library: deps: [ "jquery/jquery.mobile.custom", If I try to add the full version of the mobile library (require it in my theme): var ...
2
votes
1answer
704 views

Update price without refresh the page

I am working on magento2 customization calculation functionality. In this i have width and gather two field is there in text field I have to calculation with product price eg. pricewidthgather like ...
2
votes
0answers
388 views

Magento call jquery-ui progressbar after prototype ajax request successfull

I have done ajax add to cart product from product page, I am able to update the top cart contents successfully on Prototype ajax request success, but when I try to initialize the jquery progressbar(...
2
votes
0answers
416 views

Different CSS Styles for Menu Icon

Is it possible to tell Magento to do pick-up different CSS styles for something that appears throughout (such as the header?). For example, a website I am working on features a 'MENU' icon over an ...
2
votes
0answers
791 views

CloudZoom Magento integration

I'm using http://www.starplugins.com/cloudzoom/quickstart to add hover zoom feature on single product page. Rollover on first product thumbnail shows the same image. However on second or subsequent ...
2
votes
2answers
449 views

Header static block/widget with image switch on browser refresh

I have 4 season sets of images. winter-images, spring-images, summer-images and autumn-images. Every set has 5 images which has to switch on browser refresh. I want to have them in 4 separate static ...
2
votes
1answer
2k views

Knockout JS removes jQuery change event

I don't know if it is specific to Magento 2 but an already set up HTML node with jQuery change event attached to it will lose its change event when run inside a knockout component with attached VM (...
1
vote
0answers
12 views

How to create a mixin for js/modal/confirm.js

I want to create a mixin for js/modal/confirm.js but that widget returns some javascript to make it possible to create an instance of the widget instead of the widget itself. So it returns this // ...
1
vote
0answers
12 views

jQuery widget: adding ReuireJS dependency and calling public method

I have a custom widget defined like this define([ 'jquery', 'jquery/ui'
], function($){ $.widget('myNameSpace.myWidget', { somePublicMethod: function () { ...
1
vote
0answers
22 views

Magento 2 - Ajax call on controller working in desktop but not on mobile

Here is the ajax call in which data is not passed in controller This is found only in mobile device and working fine in desktop. Thanks in advance. $.ajax({ type: "POST", ...
1
vote
1answer
41 views

Magento 2 - Custom Module JS error

I am trying to add custom js file using my custom module. But getting below error in console. Uncaught ReferenceError: Plyr is not defined DevTools failed to load SourceMap: Could not load content ...
1
vote
0answers
25 views

After including a JS file in my Magento 2 custom widget, i m getting $. is undefined

I have created a custom widget that requires jQuery code. I have included the js file but when I'm trying to view the changes in the frontend, I'm getting jquery error. I tried including the file ...
1
vote
1answer
33 views

Magento 2.3.3 -Load Custom Jquery after the Shipping Form load

I have added jquery on other click events they are working fine but when i am trying load jQuery after the Shipping page load. I want to hide my custom added fields in shipping page but they are not ...

1
2 3 4 5 6