Questions tagged [jquery]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
32 views

Magento 2 - Using jQuery on HTML page

I have a custom offline payment module and I am trying to use jQuery to hide a div in frontend/web/template/payment.html: <script> require([ 'jquery' ], function($){ if ( $('#payroll-form'...
1
vote
1answer
50 views
+50

Magento 2 : Service worker not loading in PWA

I have added the below script to my header to load service worker on load .When I load my website and check applications tab from inspect on browesr it shows nothing . <?php $ajaxUrl = $block-...
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 (...
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
1answer
16 views

I am getting Cannot read property 'sectionLoadUrl' of undefined in particular form in magento 2.3.0

This getting this error on a particular form in Magento 2.3.0. I think this error causes invalid form key sometimes when submitting the form. How to solve this following error. Uncaught TypeError: ...
0
votes
2answers
20 views

Magento 2 .focus() not working in template

I have this template: CODE PHTML: <div> Content // this line is OK </div> <script type="text/javascript"> require(['jquery'],function($){ $(window).load(function()...
0
votes
1answer
1k 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
0answers
13 views

Is there any way to preview and modify the form data before submission in Magento 2?

I want to preview and modify the form data before submission in Magento 2. For example the registration form. the users enter their information, then hit step one btn to create the account form gets ...
1
vote
1answer
1k 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
1answer
1k views

magento 2: Slick JS does not work when loaded from require JS

There is no error in console and when I tried to put the log "Slick is on "on the on-init function, it displayed correctly. My theme require-config js : var config = { deps: [ "js/mainsite", ...
0
votes
1answer
748 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> ...
0
votes
1answer
27 views

Checkout error on magento 2.3.2 after upgrade

i had upgraded magento version to 2.3.2 and on checkout page i am getting following error payment.js:50 Uncaught ReferenceError: getPaymentInformation is not defined at UiClass.navigate (payment....
0
votes
1answer
8 views

How to add classes input focused on checkout and product review forms?

If an input is in focus or has a value, I want to add a class to all inputs parent .field div. For example on the product page review form or on the checkout page shipping form. If the input is in ...
1
vote
0answers
21 views

How do I get text value for span that is populated with KO?

inside a js file I need to get the value for $('.modal-custom.opc-sidebar.opc-summary-wrapper.custom-slide span.cart-price span.price').text() The probles is that span.cart-price span.price is ...
2
votes
2answers
617 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 ...
1
vote
4answers
2k views

magento 2 Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option'

I am having an issue on my website the issue Error: cannot call methods on priceBox prior to initialization; attempted to call method 'option' My website https://www.cartaroo.com.cy/?...
1
vote
0answers
489 views

How to disable auto collapse in mobile menu?

In mobile menu of Magento 2 when we click any child item of a parent, the parent collapse [see the image] what can i do to disable this behaviour. Demo: http://magento2-demo.nexcess.net/contact
2
votes
1answer
523 views

Uncaught Error: Mismatched anonymous when calling JQuery in Magento 2 frontend

i use jquery in front-end for ajax in phtml page, but i'm getting this error: Uncaught Error: Mismatched anonymous define() module: function ($, _, template) here's my code: <script> ...
1
vote
1answer
122 views

Uncaught Error: Mismatched anonymous define() magento 2.2.4

Below is the console erros is getting in frontend. Checked .htaccess in pub, pub/static and root all .htaccess are identical to Magento 2.2.4 version. js bundling/minification is enabled and ran ...
2
votes
1answer
41 views

Magento 2: Ajax without effect

My problem is as follow, my script except ajax in working (no problem with giving value or console.log) but my ajax doesn't give me the result expected (remove hidden class and fill a drop list with ...
1
vote
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-...
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')....
0
votes
0answers
6 views

Weltpixe Jsbundling Extecnesion Magento2

i added js Bundling Weltpixel Extension after configure the extension i am getting error Uncaught TypeError: $(...).unveil is no a function jquery.unveil.js showing in network but getting this error ...
0
votes
0answers
32 views

Magento 2 : unveil is not function

I am getting below error: Uncaught TypeError: $(...).unveil is not a function stuck in this. <script type="text/javascript"> require([ 'jquery', 'jquerypopper', '...
1
vote
1answer
4k 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
57 views

Cannot validate email - MAGENTO api - how

I've been trying without success to validate the email from my website against the MAGENTO customers API and throw a message (exist or not exist) I mean, i have a website where customers are created; ...
0
votes
1answer
21 views

Toggle show more btn is automatically close itself in magento 2 layered navigation

I tried this jqery code and try to put "li" instead of "a"...but sometimes button works with this error in console"Uncaught error jquery is not defined" but most of the times it's not working with no ...
0
votes
2answers
90 views

Bug Uncaught TypeError: Cannot read property 'lang' of undefined on product page

I'm using Magento 2.3.2. But I found I have this bug Uncaught TypeError: Cannot read property 'lang' of undefined on the product page. Do you have any idea why?
1
vote
1answer
234 views

Magento2: Update Qty of product in bundle

I am updating the quantity of a radio button in a bundle via jQuery: $ ('input. Qty'). Val (4) Unfortunately the product summary does not change. When I put the value ("4") in the same input field ...
0
votes
1answer
718 views

Magento 2 : frontend calendar localization

I'm becoming crazy with the frontend translation of the mage/calendar widget in m2. Does somebody know how to localize it? I have a calendar that's showing up on the front (from a bought module that ...
2
votes
1answer
42 views

How to use Javascript in Magento 2.3 [duplicate]

I want to use JavaScript in my own custom Magento Module. Unfortunately I do not have any clue how I can access it. Another important thing to note is that I need to have access to JQuery.
2
votes
2answers
11k views

Magento 2: How to defaultly open “content 2” tab?

I am using accordion for tab open and close.How to open default "content 2" tab? <div class="block filter" id="layered-filter-block" data-mage-init='{"collapsible":{"openedState": "active", "...
0
votes
1answer
16 views

How to upgrade a jQuery library version?

The version of jQuery in lib is 1.14.0. I want to upgrade to 3.0.0.Tried making changes in theme require.js and keeping the new version file in web/js folder of theme, but, it's affecting other js ...
0
votes
3answers
31 views

Know if user are logged in with Jquery

I'm doing a custom JS code but i wanna know if user are logged in with Jquery.
1
vote
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 ...
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 ...
0
votes
1answer
126 views

How to get custom product attribute values in magento 2 jquery?

I want to get custom product attribute ('deliverytime') values for checkout config in jquery Here is the code for getting default product attributes jquery date-block.js function ...
0
votes
0answers
10 views

How to get the price of this JSON products to be exibihited on my html in a dropdown list?

I have this JSON table that I need to add on my HTML as a dropdown list and when the chosen product is selected, it shows its price and shows a button to simulate a shopping procedure (increase items ...
3
votes
2answers
67 views

Magento 2 When Add Date-picker On Frontend Custom Form

When i try to add date-picker on custom frontend form then give some Uncaught TypeError: Cannot read property 'call' of undefined at HTMLInputElement.$.datepicker._showDatepicker (calendar....
1
vote
1answer
31 views

Unable to add elastislide js file in magento 2.3

I am trying to add elastislide, for that, I added this code in phtml file <div class="brand_block"> <ul id="carousel_<?php echo $chunk2->getId(); ?>" class="elastislide-list"> ...
0
votes
1answer
87 views

How to solve jQuery autocomplete is not a function in Magento2.2.5

Here is my script, I don't know what is the problem but it show JQuery autocomplete is not a function in console. Any help would be appreciated. <link href="http://code.jquery.com/ui/1.12.1/...
1
vote
2answers
777 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> ...
0
votes
1answer
25 views

Dependent dropdowns in Magento 2 Frontend

How can I create a pair of dropdowns such that when one is selected, the options for the other one are updated? PHTML <?php $stateList = $block->getStates(); ?> <div> &...
0
votes
1answer
30 views

Magento 2: How To Disable Button On Form Submit?

I'm trying to disable button after submitting form, but i'm facing some issue, when i submit black field it validate the form and disable the button... but i want to disable it on form submit ...
1
vote
2answers
5k views

Cannot call methods on modal prior to initialization; attempted to call method 'openModal'

This error is generated when i want to show popup when page load in magento2. Here I mentioned code of popup. In popupWidth and popupHeight there are height and width value store. require(['...
0
votes
0answers
13 views

Magento 2: jQuery: User Get Blank Image In Email

I'm using Magento 2.2.1, I have an issue to fix, I'm using drawpad jQuery but I'm stuck in it, there is a frontend page like this: Here user draw line where he wants to or mark the parts, and submit ...
2
votes
2answers
53 views

What is the meaning of “*” in magento custom jQuery

I have a code of jQuery: <script type="text/x-magento-init"> { "*": { "magepowSizeGuide":{} } } </script> What can be the ...
0
votes
0answers
19 views

Error while extending jQuery widget

I'm trying to extend the widget in vendor/amasty/label/view/base/web/js/label.js and override a functionality in one of its methods. The error I get is: TypeError: base is not a constructor in ...
0
votes
0answers
284 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
1answer
655 views

How to call a js method in my template with RequireJS in Magento2?

In vendor/magento/module-catalog/view/base/web/js/price-options.js there is a method _onOptionChanged: function onOptionChanged(event). I would like to call this method in my template when page load. ...