Questions tagged [javascript]

JavaScript (JS) is a client side script language which allows to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed. By default Magento 1 comes with the prototype.js library and Magento 2 comes with jQuery. Use 'prototype-js' and 'jquery' tags for questions about those libraries.

694 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
702 views

Magento 1.9.1 I have added popup after clicking on addtocart button but the page is reloading before closing the popup

Magento 1.9.1 I have added popup after clicking on ad to cart button but the page is reloading before before closing the popup, Please let me know how can http://onlineflowersdelivery.com/new/index....
1
vote
0answers
794 views

Magento 2.2.2 - RequireJS domReady! not working with Slick Product Slider

Issue Slick slider breaking/not loading properly on page load and eventually breaking the product slider Solution: Load slick slider script after entire document is loaded and parsed ...
1
vote
0answers
22 views

Updating checkout validations without typing in the field

By default, the validations on checkout fields get updated on "keyup" of the field you're typing in. Is there a way to update validations when clicking a button or by some other action, that is not- ...
1
vote
1answer
263 views

Magento 2 : How to add Js and CSS using php in a page in frontend?

In Magento 2, How to add Js and CSS using php in a page in frontend ? What are the php methods in magento 2 for adding css and js in a page object?
1
vote
0answers
185 views

Magento 2.2 I want to add plyr.js for Vimeo video, I'm getting requirjs error and Class.extend is not a function, how to solve it?

Error 1) Class.extend is not a function. 2)RequireJS Error: Mismatched anonymous define() module: function (_, utils, wrapper) { 'use strict'; 3) I'm getting black screeninsted to Video. ------...
1
vote
1answer
18 views

Split Customer Account edit

i'm trying to split the customer account edit page to 2 column I tried /public_html/vendor/magento/module-customer/view/frontend/layout/customer_account_edit.xml this is my code <page xmlns:xsi="...
1
vote
0answers
41 views

Inserted text via JS is not in POST

I've got a custom backend module. This module has a form created with xml and .phtml file. In form there's some inputs, selects and textarea (the problem). In .phtml file there's only buttons which ...
1
vote
1answer
104 views

M1.9 Jquery issue in CMS page

In my Magento installation I have JQuery 1.10 already included but I need to have a newer version of it. I added the latest version of JQery via the xml update tab in the cms page and I wrote my ...
1
vote
4answers
954 views

Static files - 500 error

I installed fresh Magento but there are no styles or js. Files are in pub folder , but if open in browser I'm getting Internal Server Error. Please help. This is localhost, wamp. Thank you! (I tried ...
1
vote
0answers
67 views

How to get child product _id in magento2?

I can get attribute _color. Now, How to get the selected child product_id in wishlist.js file in Magento2. If anyone knows please help me.
1
vote
0answers
39 views

js 'address' variable in Checkout

Can somebody explain where does 'address' variable come from in i.e file app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information 'address' is used many times as argument into ...
1
vote
0answers
442 views

How to add some custom code javascript in core widget without override

I want to modify mediabrowser widget of magento Location that implement widget in vendor/magento/module-cms/view/adminhtml/templates/browser/content.phtml browser widget stay in lib/web/mage/...
1
vote
1answer
37 views

Minicart -product_sku in Magento 2

Below file contains product_sku value. view/frontend/web/template/minicart/item/default.html file. how to get/use product_sku in custom js file .If anyone knows please explain me
1
vote
1answer
756 views

Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined

I am newbie in Web Development. I am working on a Magento ver. 2.1.6. I am getting this error on my every page after loading the page. . How can I solve this error. any help will be appreciated. ...
1
vote
1answer
349 views

Image upload problem in Magento Ver. 1.9.3.7

After upgrading to Magento Ver. 1.9.3.7 image upload to product does not work. Buttons are there, but when I click browse files, or upload image, nothing happens. No file upload form, and no error in ...
1
vote
0answers
113 views

Search through adminhtml grid not working 1.9

Magento ver. 1.9.2.4 Search through admin grids suddenly stopped working. No js files with 404 status, no errors in js console. Script productGridJsObject = new varienGrid(... is present, as it ...
1
vote
1answer
608 views

How can I add html template to the checkout onepage?

Checkout generate from onepage.phtml file that generate another html page inside like details.html for billing-address and another html file. How can I add new html file to generate inside the onepage....
1
vote
0answers
31 views

Magento 2. Adjust order of loading javascripts

I have the following navigation menu, loaded through Javascript like this: <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'> ...
1
vote
1answer
559 views

Magento2 Cant override checkout js file billing-address.js

It seems like a dumb question that was answered a lot here but I cant get it to work. I want to override Magento_Checkout/js/view/billing-address.js the file is physically under module-checkout/view/...
1
vote
1answer
133 views

Call web service from javascript

I could call web service from block with code below : $jsonObject=json_decode(file_get_contents("http://www.testservice.com:50001/Services/Magento.asmx/getPayer?input=".$datasJson)); How can i call ...
1
vote
0answers
418 views

Script in html does not work

I tried to add some javascript in details.html in vendor/magento/module-checkout/view/frontend/web/template/billing-address like in code below. details.html : <div class="billing-address-details" ...
1
vote
1answer
707 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/...
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 ...
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> ...
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
372 views

Can't submit add-to-cart AJAX form because of duplicated form in mobile friendly product page

I'm working on a mobile design for a Megento product page, what I'm basically doing is duplicating the HTML for desktop and mobile display and showing/hiding the correct design according to the screen ...
1
vote
0answers
514 views

How to remove <script> tag if the device is mobile ? M1

I am trying to remove certain dynamic script tags if the device is mobile. I have something like this to start with: Vendor/MobileDetect/Helper/Data.php : <?php class ...
1
vote
1answer
56 views

Change contact form validation

I would like to do a blur check on the contact form, but it only does the validation on the submit, I would like to know how I make this change. I'm trying like this $j('contactForm').blur(...
1
vote
0answers
646 views

Can't get ajax request post in Magento 2

In my js file i have this ajax request : var url = $(this).closest("form").attr('action'); jQuery.ajax({ type: "POST", url: url, ...
1
vote
0answers
98 views

Magento 1.x way of extending product.js

I recently found myself working with making price updates work in two places on a configurable product page. The previous dev had set up some jquery to try and catch the price updates and apply them ...
1
vote
0answers
85 views

What is the difference between the navigation and menu widgets

I've just noticed Magento 2 has two widgets that sound very similar, the menu widget and the navigation widget. They are both customised versions of the Query UI Menu widget and they both use the ...
1
vote
0answers
59 views

Magento 2 Add Javascript

I have the following code in a custom module for admin backend, which is not running. tinymce.html <textarea class="admin__control-textarea wysiwyg" data-bind=" value: value, valueUpdate: ...
1
vote
0answers
72 views

How to get pop up on button click popup with ajax call

On Shipping method section after select shipping option i want to open pop Up with 2 button submit & cancel on click on submit button i want to check my logic via ajax call
1
vote
1answer
93 views

Making selector available to ui component / philosophy

You'd think that the selector .el in { ".el": { "Magento_Ui/js/core/app": { "components": ..... would be made available to the ui component. Instead, it's just thrown away, ...
1
vote
3answers
1k views

My javascript doesn't run in a custom magento1.9 module

I try to use javascript for a dropdown list I've implemented into a grid as shown in the image. The renderer I use for this dropdown list is like <?php class ...
1
vote
2answers
1k views

data-mage-init not working on CMS page

If I add this to a CMS page then it pull in the javascript to the page correctly: <script type="text/javascript"> requirejs(['jquery', 'bootstrap'], function (jQuery, jQueryBootstrap) { ...
1
vote
1answer
356 views

Multiply subtotoal price in minicart

I want to show two subtotal prices in the minicart. The plan is to multiply the subtotal price and print it next to the original subtotal price. The price is printed by knockout in the html file ...
1
vote
1answer
651 views

Magento won't create minified JS files

I switched my Site to production mode and enabled JavaScript minification, bundling and concatenating in the backend, expecting Magento to correctly create the .min.js files - It won't, though. First ...
1
vote
1answer
7k views

Unable to resolve the source file for error in custom theme?

I am working on magento version 2.1.3 and have a custom theme shoppersbay. For some js files it gives error like Unable to resolve the source file for 'frontend/Smartwave/shoppersbay/en_US/...
1
vote
2answers
326 views

Magento 1.x search product by specific value in http queryString

Been trying to search how to search item in magento 1.x to return JSON output when requesting something like. www.site.com/api/rest/product?desc=Dress&color=black Been to their doc and the ...
1
vote
0answers
159 views

Uncaught Reference Error

I'm getting this error message after an update that the developer of the plugin performed and it seems to be completely broken now. Is there a way I can fix this error myself? Uncaught ReferenceError:...
1
vote
1answer
154 views

How to add js libraries to Magento 2 extension via composer?

I'm wondering is there a way to add third-party js libraries to Magento 2 via Composer? The main idea of this is to separate our modules from those dependencies and to have them required via Composer ...
1
vote
1answer
230 views

Magento + RequireJS - How to use non-AMD custom javascript with jQuery?

First off, I made a custom javascript file, main.js. Quite simple; it's just this: $("#testp").text("Hello!"); #testp is in one of my phtml files, with just <p id="testp">Hello World!</p>...
1
vote
1answer
337 views

Magento 2 infinite scroll issue

I am using a magento 2 custom infinite scroll module. When I scroll down ajax request initiate and response come with new page content . But this response not updating on current content . I checked ...
1
vote
2answers
2k views

Magento 2.1.6 - Extending the dropdownDialog (lib/web/mage/dropdown.js) not working

I am trying to extend the default dropdown.js of Magento 1) Created a new JS file at app/design/frontend/<vendor>/<theme-name>/web/js/mage/dropdown.js define([ "jquery", "jquery/...
1
vote
0answers
417 views

Pricebox.js Issue Magento 2

I'm having an issue with pricebox.js/configurable.js and configurable products. They are used in quickview and on individual product pages. The first error I get is a console error calling a ...
1
vote
0answers
974 views

How to move “Place Order” button from “Review & Payments” to custom step in Magento 2 checkout?

I have create an extra step in magento 2 checkout page and put custom step after "Review & Payments" step. Now as you can see there is "Next" button on my custom step. I want here "Place Order" ...
1
vote
2answers
967 views

How to get Lazy image like Jet.com

How can I set my logo like jet.com before loading images
1
vote
0answers
52 views

How to add class to javascript document.write & shorten date format?

<div class="shipout"> <p style="margin:0;">Delivery: FAST & FREE</p> <script> Date.prototype.addDays = function(days) { var dat = new Date(this.valueOf()); dat.setDate(...
1
vote
1answer
53 views

I want to add jquery validation to my form ! How can i do it?

I am using magento's inbuilt luma theme to practise and i am not able to understand where exactly is js written how is the flow ? This is my basic view page. And is working fine i want to add jquery ...

1
3 4
5
6 7
14