How to resolve the SyntaxError: “use strict” occured in Java Script

The JavaScript exception “’use strict’ not allowed in function” occurs when a “use strict” directive is used at the top of a function with default parameters, rest parameters, or destructing parameters. Error: SyntaxError: Illegal ‘use strict’ directive in function with non-simple parameter list (V8-based) SyntaxError: “use strict” not allowed in function with default parameter (Firefox) SyntaxError: “use strict” not… Continue reading How to resolve the SyntaxError: “use strict” occured in Java Script

How to resovle the “ReferenceError: event is not defined” in javaScript events

This error is thrown when you try to access a variable that is undefined or is outside the current scope. If you’re getting this error when using the event handling system, make sure you use the event object passed in as a parameter. Older browsers like IE offer a global variable event, and Chrome automatically… Continue reading How to resovle the “ReferenceError: event is not defined” in javaScript events

Adding functionality to continue and back buttons using script

Functionality of the working of continue and back button can be given using script. Create Continue and Back buttons in template file and assign an attribute. Then in extension give the functionality to the buttons as per the requirements, here in the screenshot the functionality is given to hide or show a container. Here the… Continue reading Adding functionality to continue and back buttons using script

Hide and Show Containers Using hide and show function in script.

We can hide and show specific Containers in a page by using Script by giving the click function to the buttons. Firstly create the buttons you want to give the functionality to using HTML and Style it. To give the functionality of click action to the button use onclick function and also create the events… Continue reading Hide and Show Containers Using hide and show function in script.

Creating badge for items in Cart page to Display desired messages.

Badges are used for displaying any special message for any item, for example to display the “NEW ARRIVAL” of an item or the “DISCOUNT” on any item. Here we are creating a badge for the items present in the cart page. Steps:1. Create a new extension for Cart item badge.2. Create a custom field in… Continue reading Creating badge for items in Cart page to Display desired messages.