Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
1k views

jQuery multiple input types in one form

I got multiple input types in my form based on positions. <input type="file" name="file" id="file" data-positionid="<?php echo $positionId; ?>" class="inputfile" /> Now i want on change ...
0
votes
1answer
991 views

Uncaught TypeError: Cannot read property 'innerHTML' of null

We have tried to do a checkout on our website but its not working. When looking into the console, it says the below error Uncaught TypeError: Cannot read property 'innerHTML' of null and its ...
0
votes
0answers
12 views

pagination using jquery

I have a search bar on my page when I search for something it returns the result perfectly with correct pagination. As shown below but when I clicked on page 2, it returns the data correctly but ...
0
votes
0answers
9 views

Magento2: How to get clicked page number on pagination

My pagination is working fine. But in ajax I only want to get page number which is clicked. For example I have products on 10 pages. When I click on page 2 it alert only 2, when click page 3 it alert ...
0
votes
0answers
69 views

Magento 2: Error Disable some dates in jquery Datepicker

I try to add datepicker in magento 2 checkout page like this: ko.bindingHandlers.datepicker = { init: function (element, valueAccessor, allBindingsAccessor) { var $el = $(...
0
votes
0answers
16 views

check all check boxes with just one click

I have one check box on the top of the page. scenario: I want to check all checkboxes on each line by just clicking that top check box and uncheck all the checkboxes on each line by unchecking that ...
0
votes
0answers
18 views

Display checked radio button custom option value in product detail page Magento2

Below are custom option of Radio Button Type. How to Display <span> value under the <label> when customer checked Radio button using Jquery? Here All class are dynamic. Example: As per the ...
1
vote
1answer
1k views

How to Auto Select Color Option for Products with Only One Color (configurable product)?

I have some configurable products with a custom color swatches attribute. Lot of them have just one color options, so i 'd like to mark the option as selected in the product page. I added a custom js ...
6
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 ...
0
votes
1answer
18 views

Magento 2.4.1: Uncaught Error: [object Object] at Object.<anonymous> (default.js:8474)

The error as the post title appears in the cart page. default.js is the bundle that I created with advanced JS bundling. You can see that this is where the error has originated from. When looking at ...
0
votes
0answers
9 views

Replace <div> of page with <div> comes from $.ajax response

Problem is written inside the success section. $.ajax({ url : 'path to file', dataType : 'json', type : 'POST', data: data, success : ...
4
votes
6answers
6k views

How to disable JQMigrate Logging

We keep receiving this log and stack trace from JQMigrate, but it seems to just be a warning. Is there a way to just straight up disable logging in production?
0
votes
0answers
14 views

jQuery is not defined in Checkout Magento 2.4.1

I'm in Checkout and sometimes I receive the following error: Uncaught TypeError: jQuery is not defined This error is thrown by file jquery-migrate.js in line 10 that contains this: jQuery....
0
votes
1answer
15 views

Unable to select first value from dropdown in jquery

I populated the dropdown with the help of array. for example I have array with elements (ali,abid,naqvi). Problem..... when I clear the cache and reload the page. and first time I am unable to select ...
1
vote
1answer
2k views

Adding to cart breaks fotorama on page reload

Fotorama works normally until I click add to basket. After the page reloads this then shows collapsed (as per the image) and logs a couple of errors to console. fotorama.js:99 Uncaught Fotorama ...
0
votes
2answers
26 views

Magento 2 custom module jQuery loading issue

My custom module: app\code\Zero\my_module\view\frontend\web\js\changezipcode.js define(['jquery'], function ($) { 'use strict'; $(document).ready(function() { $('#form'...
0
votes
1answer
997 views

Product detail page image not loading on front end

Product detail page images are not loading. The pointer is just spinning. I have read lots of threads. Clear cache, reindexed, change permissions. Finally, I got a problem. but unable to fix it. :-/ ...
0
votes
0answers
12 views

Show a loading icon until the page loads on Magento 2.3.6?

I'm new to Magento 2 site. I'm running a site on 4 GB ram and 1 CPU processor. So the site is loading slow. And users are trying to click before it loads completely. I want to show a loading image ...
1
vote
1answer
879 views

Magento 2 - jQuery validation remote method

I'm developing a custom form with a username that require validation at server side to check if the username exists. How can I apply the remote method of jquery validation plugin in Magento 2?
1
vote
1answer
3k views

Sending variable to a bootstrap modal

I have seen this asked before but a lot of the answers I found where people looking to get a variable into a modal to query a database. However thats not what I want. I just want to send a variable ...
0
votes
0answers
10 views

Customisation create one array and in that array add all check boxes option ids Magento ver. 2.3.2

How to create one function in magento 2 and every customisation create one array and in that array add all check boxes option ids.
0
votes
2answers
2k views

Error cart message on Ajax

My goal is to have a cart that live updates when you change the quantity's. Normally you need to press the 'update cart' button. So I update my cart live by doing this: require(['jquery', '...
0
votes
3answers
618 views

Cannot read property 'bind' from copy of mage/menu.js

I am trying to create a custom menu in Magento 2, but I run into the following browser console error when I add the JavaScript file for it. main.js:27 Uncaught TypeError: Cannot read property 'bind'...
0
votes
1answer
2k views

Lots of jQuery conflicts on Magento 2

I'm working on a new Magento 2 installation with the Porto theme and have noticed that when you first visit the site or have the browser cache disabled you get a lot of of jQuery conflict errors. ...
1
vote
1answer
1k views

Magento 2: How to use event trigger on the checkout page?

How to use event trigger when change "State/Province " drop-down on the checkout page? I'm trying to page reload when user change Region from "State/Province" dropdown in the checkout page. First, ...
0
votes
0answers
26 views

Magento2.4: Checkout Page loading issue

when I login into the checkout page after login checkout page not loading only loader loads. in console Getting this error: Uncaught Error: Syntax error, unrecognized expression: a[href=#shipping]
0
votes
1answer
37 views

Magento 2 - include JS library without Require.JS

I'm trying to include the jsPDF library in my Magento 2 like this: <script type="text/javascript" src="<?php echo $this->getViewFileUrl("Vendor_Module::js/jsPDF.js");...
0
votes
1answer
2k views

Getting jQuery.browser is deprecated error in console magento 2.1.5

I keep on getting this error in my console, JQMIGRATE: jQuery.browser is deprecated migrateWarn @ jquery-migrate.js:41 get @ jquery-migrate.js:58 (anonymous) @ jquery.ba-hashchange.min.js:9 (...
0
votes
0answers
16 views

jQuery (server side) search and sort using Ajax

I tried to create search and sort from live URL using Ajax , i used do search function and i managed to retrieve the data from the URL . I am showing Ajax response in select options as below code. I ...
1
vote
1answer
398 views

Magento 2: Autoplay product video when video icon on left panel is clicked?

I want to autoplay video when video icon on the left panel is click. Once the video icon is click the video on the container will automatically play. Here is the current classes on the video icon: ...
0
votes
1answer
2k views

QuickSearch widget Magento 2. How to make closed search

I read a lot documentation and see code search. But don't understand how make an opening search by clicking on the icon. Mobile version have opening search by clicking on the icon. How make same for ...
0
votes
1answer
12 views

Magento 2 get country Id when on change in estimate shipping on cart page

Due to some custom requirement on cart page, I need country id when someone change it using jquery. I have tried with below jquery script but its not working. <script> require(['jquery', '...
0
votes
1answer
3k views

Magento 2.3 - Uncaught TypeError: Cannot read property 'version' of undefined [closed]

Installed Magento 2.3.1 with sample data there are no js errors on the console. After changing the theme to Ves Need from Venustheme. http://www.venustheme.com/theme/ves-need/ On hard refresh, the ...
0
votes
3answers
33 views

Magento 2 How to combine custom module JS in one JS file?

I have multiple modules installed on my website, all modules have scripts in phtml file. I need to move that all scripts into one JS file so it can reduce the page size and merged them as a JS file. I ...
2
votes
2answers
842 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 ...
0
votes
0answers
9 views

jQuery must click twice

I have moved my Yotpo reviews on the product page to be shown in the tabs. Everything works but i have to click twice on the star rating to open my review tab. I should only click once for the tab to ...
3
votes
1answer
1k 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 ...
0
votes
2answers
2k views

How can initialize a function mobile only?

CODE HTML: <div id="element"> <div class="col-md-3"> <div data-role="collapsible"> <div data-role="trigger"> <span>Title 1</span> ...
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')....
1
vote
1answer
960 views

Magento 2: Frontend file uploader (jquery)

I need my users to be able to upload some files from the backend, with the functionality of a preview image, abort button, multiple files uploadable, etc. And since Magento already uses the blueimp/...
0
votes
1answer
40 views

Magento2: Sometime js load sometime js not load properly

I got the JS error in console. Sometime when page load got the JS error and Sometime when page load it is working. I don't know what's the exact issue. I disabled all 3rd party extension after that ...
1
vote
1answer
5k views

Blocked a frame with origin from accessing a cross-origin frame

when I want to go onclick to next page's specific div it shows this error . jquery.js:3123 Uncaught DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a ...
0
votes
1answer
47 views

How to add append jquery function in magento

in my case I want to add the 'div1' class to the 'div2' class but I don't really know how to do it. I tested a code but after the else part, the code doesn't execute (just the append method not other ...
0
votes
2answers
1k views

Owl Carousel not working in Chrome

I've got a carousel (Owl Carousel) on my home page that doesn't work on Chrome but does work in other browsers. I believe it is something to do with Jquey loading after the carousel but I'm not 100%. ...
0
votes
0answers
28 views

How to check all elements of first array with single element of second array one by one using jquery

Like I have two arrays and I wan't to disable value from drop down which are greater then single element of array. ['5', '10', '15', '20', '25', '30'] // dropdown ['10', '15', '20'] // second array ...
1
vote
1answer
48 views

how to add jquery on magento 2

I am using Magento 2, in my case I want to add an element after another using jQuery, can anyway tell me how to it, the best practice please For example i want to insert a div with class 'one' after ...
0
votes
0answers
7 views

Create a Multidimension array and convert this in JSON format

I want to create JSON data to pass in AJAX. I'll pass the dynamic value of country & postcode in the below JSON. Let me know how to perform this task. Required data to pass in JSON {"address&...
1
vote
2answers
1k views

Show div after delay on Magento 2 with JQuery

I need to show this div after 3 seconds on my page. <div id="cratepop"> <br> <center><img src="/shoppingcart.png"></center> <br> </div> ...
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 ...
2
votes
1answer
2k 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 ...

1
2 3 4 5
16