How to use anchor link in escapeHtml text in magento 2?

Magento escapeHtml() method used to define translate specific text messages in the template files.

You can use the escapeHtml() function to define normal as well as HTML text to translate out of the box in the template.

In the method, the first argument takes data as a text message and the second argument is the array value of specific HTML tags to escape from the string. Continue reading “How to use anchor link in escapeHtml text in magento 2?”

How to fixed Uncaught SyntaxError: Unexpected token } in JSON at position Magento?

Magento page console error Uncaught SyntaxError: Unexpected token } in JSON at position 530 while you have made mistake to your code.

Code with Error in a template file: Continue reading “How to fixed Uncaught SyntaxError: Unexpected token } in JSON at position Magento?”

How to resolved Uncaught SyntaxError: Unexpected token ‘ in JSON at position 159 in Magento?

While Developing features with Magento and javascript, sometimes you are facing an error in the browser console for the unexpected token defined in JSON and that will break your Magento functionality on that page.

This type of error we are facing is due to tiny mistakes in javascript JSON Declaration in our code.

This error is coming because our javascript snippet declaration using script text x-magento-init syntax has minor mistakes. Continue reading “How to resolved Uncaught SyntaxError: Unexpected token ‘ in JSON at position 159 in Magento?”