Unable to parse JSON-LD tag and how to fix malformed JSONArticle contains
  1. Understanding JSON-LD malformation
    1. [Facebook Pixel] - Unable to parse JSON-LD tag. Malformed JSON found.
    2. Common encoding issues
  2. How to fix malformed JSON-LD
  3. How do we create JSON?
    1. Creating JSON string in JavaScript
    2. Creating JSON string in PHP
    3. Creating JSON string in C#
  4. Conclusion
Random pattern reminiscent of the Matrix movie

Unable to parse JSON-LD tag and how to fix malformed JSON

JSON-LD (JavaScript Object Notation for Linked Data) is a lightweight Linked Data format that is easy for humans to read and write.

However, when JSON-LD is malformed, it can lead to parsing errors that prevent search engines and applications from correctly interpreting the data.

To address issues related to Unable to parse JSON-LD tag and fix malformed JSON, it is essential to understand the common causes and solutions for these errors.

Continue reading “Unable to parse JSON-LD tag and how to fix malformed JSON”
Umbraco CMS and compressing images on the client side before uploadArticle contains
  1. Compressing images on the client side in Umbraco site
  2. Adding a custom script to the master template in Umbraco
  3. Help with installation
  4. About Umbraco
The sculpture is in a park. It features outdoor surroundings with grass, trees, and plants. The sculpture is in silver and is an art installation in the park.

Umbraco CMS and compressing images on the client side before upload

Compressing images before uploading them to a website or application can significantly improve load times, reduce bandwidth usage, save space on a server, and enhance the user experience. Faster loading of images is an important ranking factor in SEO activities.

If you use Umbraco CMS, have a site based on it and want to have a feature for transparently optimizing images on the client, then using npm package @sitelintcode/optimize-image-on-the-client-side is a solution for you.

Continue reading “Umbraco CMS and compressing images on the client side before upload”
Use JavaScript to determine whether a string is a valid JSON stringArticle contains
  1. Check if provided string is a valid JSON string code
  2. Code explanation
The text "JavaScript. Is my string a valid JSON string?" on a desert.

Use JavaScript to determine whether a string is a valid JSON string

To determine whether a string is a valid JSON string in JavaScript, you can use the JSON.parse() method within a try...catch block. This approach leverages the fact that JSON.parse() throws a SyntaxError exception if the input string is not valid JSON. By catching this exception, you can accurately determine if the string represents valid JSON.

Continue reading “Use JavaScript to determine whether a string is a valid JSON string”
Making chatbots accessible: A guide to enhance usability for users with disabilitiesArticle contains
  1. Visual accessibility
  2. Auditory accessibility
  3. Motor accessibility
  4. Cognitive accessibility
  5. Universal design features
  6. Testing and feedback
  7. Compliance and ethical considerations
  8. Technical advises
  9. General recommendations for choosing an accessible chatbot platform
    1. Customizability
    2. Compliance with WCAG standards
    3. Testing capabilities
    4. Support for rich media accessibility
    5. Keyboard navigation
  10. Final words
A person using a tablet indoors. The person is interacting with the device, reading and typing messages on the chat app.

Making chatbots accessible: A guide to enhance usability for users with disabilities

Previously, we discussed the Urgent Need for Chatbots to be Accessible. In this piece, we are taking a deep dive into actions one can take to enhance the accessibility of chatbots for users with disabilities. In order to meet that end, programmers can implement several specific strategies that address visual, auditory, motor, and cognitive impairments. This guide offers detailed instructions, practical code examples, and tool recommendations to make chatbots more accessible.

Let’s get started.

Continue reading “Making chatbots accessible: A guide to enhance usability for users with disabilities”
Truncating text and making it accessibleArticle contains
  1. CSS techniques for truncation
    1. CSS for single-line text truncation
    2. CSS for multi-line text truncation
  2. JavaScript for truncation
    1. Truncating text by words
    2. Truncating by characters
    3. Truncating in the middle
  3. How do JavaScript solutions differ from CSS truncation techniques?
    1. Flexibility and dynamic content manipulation
    2. Performance considerations
    3. Use cases
  4. Accessibility considerations
  5. Alternatives to truncation
  6. Avoid information loss
Redirecting to www or non-www using Apache htaccessArticle contains
  1. Using .htaccess to redirect to www or non-www
    1. Redirect from www to non-www
    2. Redirect from non-www to www
macOS - find, start, stop, and restart the Apache web serverArticle contains
  1. Determine which Apache server is currently being used on macOS
    1. Check running Apache processes
    2. Using which and whereis commands
    3. Check Apache configuration
  2. Internal Apache
  3. Homebrew Apache
  4. Conflict between internal Apache and Apache installed via Homebrew
  5. How to stop and prevent auto-starting the internal Apache server on macOS
  6. apachectl vs httpd
    1. apachectl
    2. httpd
MacBook computer and Apache Server logo on it.

macOS – find, start, stop, and restart the Apache web server

Trying to find out if the Apache server is running on macOS? How do I find it? And once you find it, why are there several methods to start, stop, and restart it?

Managing the Apache web server on macOS involves using specific commands in the Terminal. The commands differ slightly depending on whether you are using the built-in Apache or one installed via Homebrew. Here’s a comprehensive guide to starting, stopping, and restarting both versions.

Continue reading “macOS – find, start, stop, and restart the Apache web server”
Resolving the script tag type attribute hash prepending issue with CloudflareArticle contains
  1. Solution for hash prepending issue with Cloudflare
  2. Final notes
"JavaScript" sentence and script HTML element

Resolving the script tag type attribute hash prepending issue with Cloudflare

If your script HTML tag has the type attribute prepended with a hash, like <script type="ea10e272b0a1989fb2f3aa4e-text/javascript">...</script> and you’re using Cloudflare services, then the root cause is the Cloudflare Rocket Loader, a feature of Cloudflare that optimizes the loading of JavaScript resources on your web pages.

Rocket Loader modifies the type attribute of script tags for website loading optimization by deferring the loading of JavaScript until after rendering. This modification can sometimes cause issues with HTML validation and Content Security Policy (CSP) headers.

Cloudflare Rocket Loader adds an argument “type” into the script tag and causing issues with the W3C validator due to the “subtype missing” error.

Continue reading “Resolving the script tag type attribute hash prepending issue with Cloudflare”
Get days between two dates in JavaScriptArticle contains
  1. JavaScript code for calculating days between two dates
  2. Code explanation
  3. Practical example with unit tests for calculating days between dates
Get and capitalize the first letter of a string in JavaScriptArticle contains
  1. How strings are represented in JavaScript?
  2. Getting and capitalizing the first character of a string in JavaScript
  3. Practical example: Capitalizing the first letter of a string