Experiencing issues and alerts when handling JSON data

Here is the Json data I am attempting to represent using Json-LD :

var schemaOrg = angular.toJson({
        "@context": "http://schema.org",
        "@type": "RealEstateAgent",
        "RealEstateAgent": {
                "@type": "RealEstateAgent",
                "address": "123, Xyz Tower, ajkshjask", 
                "areaServed": "Chicago",
                "brand": "My Brand",
                "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6a0b08092a0d070b030644090507">[email protected]</a>", 
                "knowsLanguage": "English",
                "legalName": "Jerry Kon", 
                "image": "http:samplepic.com",
                "description": "I am great",
                "name": "Jerry Kon",
                "url": "http:myprofilepic.com",
                "Telephone": "1234567899"
            }
    });

This is how I am rendering it:

<script type="application/ld+json" id="json-ld-music-group"></script>

angular.element(document).ready(function () {
                        var jsonLd = angular.element(document.getElementById('json-ld-music-group'))[0];
                        console.log(jsonLd);
                        jsonLd.innerHTML = schemaOrg;
                        console.log(jsonLd.innerHTML);
                    });

When I copy and paste the entire HTML and test in Google Structured Data Testing tool, I receive a warning and error that I do not understand. The tool flags the name and image properties even though they are present in my data. It also warns about the address and telephone fields. Can someone assist me in resolving this issue?

Answer №1

There appears to be a nesting of RealEstateAgent inside another RealEstateAgent, which is not valid. It should be flattened down to a single instance for correctness:


    {
      "@context": "http://schema.org",
      "@type": "RealEstateAgent",
      "address": "123, Xyz Tower, ajkshjask", 
      "areaServed": "Chicago",
      "brand": "My Brand",
      "email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1273707152757f737b7e3c717d7f">[email protected]</a>", 
      "knowsLanguage": "English",
      "legalName": "Jerry Kon", 
      "image": "http:samplepic.com",
      "description": "I am great",
      "name": "Jerry Kon",
      "url": "http:myprofilepic.com",
      "Telephone": "1234567899"            
    }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Conceal the .dropdown-backdrop from bootstrap using solely CSS styling techniques

Is there a way to hide the .dropdown-backdrop element from Bootstrap for a specific dropdown on a webpage using only CSS? I found a solution that involves Javascript, you can view it on JSFiddle here. However, I am hoping to achieve this without relying o ...

Utilize Angular UI Bootstrap Typeahead to exclude specified fields

I have implemented the Angular UI-Bootstrap typeahead feature for finding friends. <input type="text" name="recipient" id="recipient" placeholder="Friend's name or username" autofocus="autofocus" class="form-control" ng-model="payment.recipient ...

Oops! Looks like there's a problem with the syntax - the import statement can't be

I encountered an error while trying to create Sequelize migrations in my Node.js app (which is set up with Typescript). When running npx sequelize-cli db:migrate, I received an "import method" error, but I'm unable to pinpoint the source of this issue ...

Activate a change or response when the input value in Javascript is altered

Currently, I am working on a small project using JQuery and facing an issue when trying to remove error classes from HTML elements. To handle the removal of the error classes, I am utilizing $('selector').on('input') event to target th ...

AngularJS dropdown displays accurate text, yet incorrect value selected

Here is the code for my dropdown selection: <select class="form-control form-controls input-sm" ng-model="vm.retailer.state" ng-options="state.code as state.name for state in vm.states" required> <option value="">-- Select a State --</o ...

Graph using chartjs-node-canvas in dark mode

I am currently incorporating the chartjs-node-canvas library into my Protractor test written in JavaScript. However, I am facing an issue where my chart appears completely black - to be more precise, only the white frame of the square is visible without an ...

Using conditional binding with AngularJS, the value will only be concatenated and bound if the property is not empty

As a beginner with Angular, I am attempting to link a string to a model as long as the value is not empty. This is successful for a single input, but I now want to merge multiple text inputs into a single string. <input type="text" ng-model="data.sou ...

Capitalize the host name from both the current HTTP request in the HttpContext object and the

Curious inquiry, I must admit, but nonetheless, is it possible for HttpContext.Current.Request.Url.Host or window.location.host to return a value in uppercase? Would it be advisable to utilize .toLowerCase and .ToLower methods to ensure everything goes s ...

Problem Installing Express Sharp using Docker

When deploying via Docker, I encountered an error with sharp, even though it works fine on my workspace. I followed all the steps but still faced issues. Error: 'linux-x64' binaries cannot be used on the 'linuxmusl-x64' platform. P ...

Is there a way to extract specific data from a JSON file and calculate the average in order to generate a line graph using JavaScript

I am working with data in json format and I want to create plots using plotly js. Specifically, I need to generate a plot showing different states by semester. To do this, I first need to filter the data for each state (for example, California), calculate ...

NicEditor's Image-Uploading Feature

Currently, I am utilizing nicedit.js as the content editor for my website. I am interested in learning how to modify the image uploading location and also create a PHP file to facilitate this process. I have accessed a specific file on containing the scr ...

Filtering a string that contains commas using another string that also contains commas

I need help with removing elements from one comma-separated string based on another. String 1: 6,2 String 2: 1,2,4,5,6,7,9,12,13 Is there a function or method that can accomplish this task for me? ...

Discontinue playing videos embedded in iframes on Dailymotion

I'm currently working on creating a slider that includes videos from multiple providers, and I need to ensure that the videos stop when changing slides. So far, I've successfully implemented this feature for Vimeo and YouTube without making any a ...

Capture a screenshot of the icons

I'm curious about displaying specific parts of images in a React Native application. class InstaClone extends Component { render() { return( <View style={{ flex:1, width:100 + "%", height:100 + "%" }}> <View style={st ...

What is the process for exporting Three.js files to .stl format for use in 3D printing?

I stumbled upon a page with this link: Is it possible to convert Three.js to .stl for 3D printing? var exporter = new THREE.STLExporter(); var str = exporter.parse(scene); console.log(str); However, despite using the code provided, I am unable to export ...

Why does the Roman to Integer conversion in JS only convert the first character?

Struggling with Leedcode question 13: Given a roman numeral, convert it to an integer. The input is guaranteed to be within the range from 1 to 3999. I've written some code below, but I'm puzzled as to why it only converts the first character in ...

Leverage the power of v-model props in your Vue 3 component to efficiently retrieve API breakpoints

I am currently working on integrating the API breakpoints in my child component. These components are designed for my football web application. The breakpoints are sourced from: api-football My challenge lies in passing multiple prop values into a c ...

No visible alterations were observed to the object following the invocation of JSONDecoder

I'm facing an issue with parsing JSON data into a struct using JSONDecoder in my function called by viewDidLoad. Even though the API call works correctly in postman, I can't seem to print the movie data in the console when I try to access it. Ins ...

What are the consequences of altering meta tags once the DOM has fully loaded?

While delving into the A-Frame source code, I noticed that the library uses JavaScript to set various meta tags. It seems safe in the context of A-Frame as Mozilla recommends importing their library as a blocking, synchronously loaded script in the <he ...

Pass additional parameter while calling a function in Vue

Visit Element on GitHub Check out the upload component <el-upload class="avatar-uploader" action="/upload" :show-file-list="false" :on-error="handleUrlError" :on-success="handleUrlSuccess"> <i v-else class="el-icon-plus avatar-uploade ...