Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 12-15-2016, 11:25 PM
jeanm jeanm is offline
Junior Member
 
Join Date: 06-10-04
Location: Bunbury, Australia
Posts: 19
iTrader: 0 / 0%
Red face I just can't see what is wrong here

I'm trying to update my very old and neglected recipes website. I've just started using the structured data testing tool for "recipeIngredient". There is apparently an error on the very bottom line of the code but I can't see what I've done wrong.

This is the sectiont of the code:
Code:
"recipeIngredient":[ "2 packets of two minute noodles", "200 gm mushrooms, sliced", "1 teaspoon oil, to cook mushrooms", "1/2 cup diced cold cooked meat such as chicken or ham", "4 spring onions, chopped finely", "1/2 cup grated carrot", "1/2 cup finely shredded cabbage", "6 eggs, beaten", "Salt and pepper, to taste", "1 tablespoon oil to cook omelettes", ],
There is not much even on the bottom line but still I've got it wrong. The error says:

Syntax error: value, object or array expected.

Am I still missing something please?

All assistance gratefully taken on board. Thanks, Jean
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 12-17-2016, 11:35 AM
gxnpt's Avatar
gxnpt gxnpt is offline
Contributing Member
 
Join Date: 09-10-16
Location: far west Florida near Destin
Posts: 104
iTrader: 0 / 0%
Just a PHP/Javascript coder here, but
Code:
"recipeIngredient":[ "2 packets of two minute noodles", "200 gm mushrooms, sliced", "1 teaspoon oil, to cook mushrooms", "1/2 cup diced cold cooked meat such as chicken or ham", "4 spring onions, chopped finely", "1/2 cup grated carrot", "1/2 cup finely shredded cabbage", "6 eggs, beaten", "Salt and pepper, to taste", "1 tablespoon oil to cook omelettes", ],
looks like it wants another value after the comma (or drop that comma)
 
Reply With Quote
  #3  
Old 12-19-2016, 07:33 AM
jenniferrainey jenniferrainey is offline
Junior Member
 
Join Date: 12-15-16
Posts: 7
iTrader: 0 / 0%
It looks like JSON format. It should be like below.
Code:
{ "recipeIngredient": [ "2 packets of two minute noodles", "200 gm mushrooms, sliced", "1 teaspoon oil, to cook mushrooms", "1/2 cup diced cold cooked meat such as chicken or ham", "4 spring onions, chopped finely", "1/2 cup grated carrot", "1/2 cup finely shredded cabbage", "6 eggs, beaten", "Salt and pepper, to taste", "1 tablespoon oil to cook omelettes" ] }
 
Reply With Quote
  #4  
Old 12-19-2016, 06:48 PM
HTMLBasicTutor's Avatar
HTMLBasicTutor HTMLBasicTutor is offline
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 26,637
iTrader: 5 / 100%
Perhaps there is something above this that is causing the error? e.g. The W3C Validator will show an error because of something wrong above the specified point.
 
Reply With Quote
  #5  
Old 12-20-2016, 11:12 AM
gxnpt's Avatar
gxnpt gxnpt is offline
Contributing Member
 
Join Date: 09-10-16
Location: far west Florida near Destin
Posts: 104
iTrader: 0 / 0%
check this first

Eliminate the trailing comma I red flagged in my earlier post (the one after the last value and just before the ] bracket) and test.

If you still have the same or a similar problem you may have another trailing comma after the ] bracket, unless some other element comes after that comma in your code.

Quote:
"1 tablespoon oil to cook omelettes" ,
] ,
 
Reply With Quote
  #6  
Old 12-24-2016, 12:02 AM
netcode netcode is offline
Junior Member
 
Join Date: 11-27-16
Posts: 30
iTrader: 0 / 0%
Quote:
Originally Posted by jeanm View Post
I'm trying to update my very old and neglected recipes website. I've just started using the structured data testing tool for "recipeIngredient". There is apparently an error on the very bottom line of the code but I can't see what I've done wrong.

This is the sectiont of the code:
Code:
"recipeIngredient":[ "2 packets of two minute noodles", "200 gm mushrooms, sliced", "1 teaspoon oil, to cook mushrooms", "1/2 cup diced cold cooked meat such as chicken or ham", "4 spring onions, chopped finely", "1/2 cup grated carrot", "1/2 cup finely shredded cabbage", "6 eggs, beaten", "Salt and pepper, to taste", "1 tablespoon oil to cook omelettes", ],
There is not much even on the bottom line but still I've got it wrong. The error says:

Syntax error: value, object or array expected.

Am I still missing something please?

All assistance gratefully taken on board. Thanks, Jean
I think your error problem is latest comma, you don't need it.

change this

Code:
"1 tablespoon oil to cook omelettes",
to

Code:
"1 tablespoon oil to cook omelettes"
 
Reply With Quote
  #7  
Old 12-24-2016, 10:23 AM
liquidwebcouponcodes liquidwebcouponcodes is offline
Junior Member
 
Join Date: 12-24-16
Posts: 13
iTrader: 0 / 0%
Try removing the comma at the end of "1 tablespoon oil to cook omelettes",

I think that shall solve the problem
 
Reply With Quote
  #8  
Old 12-24-2016, 10:43 AM
gxnpt's Avatar
gxnpt gxnpt is offline
Contributing Member
 
Join Date: 09-10-16
Location: far west Florida near Destin
Posts: 104
iTrader: 0 / 0%
Many have responded with the same answer stated in several ways - but what has happened to the one who asked the question?
 
Reply With Quote
  #9  
Old 12-24-2016, 04:56 PM
HTMLBasicTutor's Avatar
HTMLBasicTutor HTMLBasicTutor is offline
Administrator
 
Join Date: 10-29-07
Location: Canada
Posts: 26,637
iTrader: 5 / 100%
Quote:
Originally Posted by gxnpt View Post
Many have responded with the same answer stated in several ways - but what has happened to the one who asked the question?
Yes they did PLUS they did not check out the applicable schema example and see it does look right and hence I suggested it is something above this that is causing the problem.
 
Reply With Quote
  #10  
Old 12-24-2016, 09:26 PM
gxnpt's Avatar
gxnpt gxnpt is offline
Contributing Member
 
Join Date: 09-10-16
Location: far west Florida near Destin
Posts: 104
iTrader: 0 / 0%
There had been no further posting from jeanm - did not know if one or both potential trailing commas had been investigated by the original poster.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong? anakha6 V7N Forum Support 4 06-08-2009 05:03 AM
Wrong Traffic, Wrong Keyword for Wrong Site! Jonathan_Hue SEO Forum 22 03-18-2008 05:33 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 01:39 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC