JavaScript exception handelling for exception “Invalid code point”

The JavaScript exception “Invalid code point” occurs when NaN values, negative Integers (-1), non-Integers (5.4), or values larger than 0x10FFFF (1114111) are used with String.fromCodePoint(). Message:RangeError: Invalid code point -1 (V8-based) RangeError: -1 is not a valid code point (Firefox) RangeError: Arguments contain a value that is out of range of code points (Safari) What Went… Continue reading JavaScript exception handelling for exception “Invalid code point”

How to magnifiy a specific part of an image when hovered over it

This teqchnique can be used for the for the pdp pages where the products are to be shown by magnifiying the products to the customers. The image must be placed inside a container with relative positioning. The result can be put anywhere on the page, but must have the class name “img-zoom-result”. Make sure both… Continue reading How to magnifiy a specific part of an image when hovered over it

Auto-filling one field same as other using JavaScript

You might have noticed that sometimes websites like e-commerce or some government website have two address fields in their forms. One for the primary address and another for the secondary address(or one for billing address and another for the shipping address etc). Most of the time people have the same primary and secondary addresses and… Continue reading Auto-filling one field same as other using JavaScript

How to solve the error “SyntaxError: JSON.parse: bad parsing” in javascript

The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON. The Error Mesages: SyntaxError: JSON.parse: unterminated string literal SyntaxError: JSON.parse: bad control character in string literal SyntaxError: JSON.parse: bad character in string literal SyntaxError: JSON.parse: bad Unicode escape SyntaxError: JSON.parse: bad escape character SyntaxError: JSON.parse: unterminated string SyntaxError: JSON.parse: no… Continue reading How to solve the error “SyntaxError: JSON.parse: bad parsing” in javascript

How to adjust the text sizes for iOS devices

Description: The text format in the iOS devices are little different from the normal devices which can be customized with this methods. SOLUTION:Adjusting the text size is important so that the text is legible when the user double-taps. If the user double-taps an HTML block element—such as a <div> element—then Safari on iOS scales the viewport to… Continue reading How to adjust the text sizes for iOS devices

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