{"id":6485,"date":"2026-05-21T13:48:21","date_gmt":"2026-05-21T04:48:21","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=6485"},"modified":"2026-10-21T13:48:27","modified_gmt":"2026-10-21T04:48:27","slug":"javascript-json-parse-unexpected-token-errors","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/6485\/","title":{"rendered":"JSON.parse\u306eUnexpected token\u3092\u5207\u308a\u5206\u3051\u308b\u624b\u9806"},"content":{"rendered":"<p>JavaScript\u306eJSON.parse\u3067\u300cUnexpected token\u300d\u306a\u3069\u306eSyntaxError\u304c\u51fa\u305f\u3089\u3001\u307e\u305a\u89e3\u6790\u5bfe\u8c61\u304c\u672c\u5f53\u306bJSON\u6587\u5b57\u5217\u304b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u539f\u56e0\u306f\u3001\u672b\u5c3e\u306e\u30ab\u30f3\u30de\u3001\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3001\u30ad\u30fc\u306e\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u4e0d\u8db3\u3001\u7a7a\u6587\u5b57\u3001API\u304b\u3089\u8fd4\u3063\u305fHTML\u306a\u3069\u306b\u5206\u304b\u308c\u307e\u3059\u3002API\u9023\u643a\u306a\u3089HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30fbContent-Type\u30fb\u672c\u6587\u3092\u9806\u306b\u78ba\u8a8d\u3057\u3001\u69cb\u6587\u304c\u6b63\u3057\u3044JSON\u304b\u3069\u3046\u304b\u3068\u3001\u30c7\u30fc\u30bf\u306e\u4e2d\u8eab\u304c\u30a2\u30d7\u30ea\u306e\u60f3\u5b9a\u306b\u5408\u3046\u304b\u3092\u5207\u308a\u5206\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>JSON.parse\u306eUnexpected token\u306f\u4f55\u3092\u793a\u3059\uff1f<\/h2>\n<p>JSON.parse\u306f\u3001\u5f15\u6570\u3092JSON\u3068\u3057\u3066\u8aad\u307f\u53d6\u308c\u306a\u3044\u5834\u5408\u306bSyntaxError\u3092\u6295\u3052\u307e\u3059\u3002\u6587\u8a00\u3084\u4f4d\u7f6e\u60c5\u5831\u306e\u8868\u793a\u306fJavaScript\u30a8\u30f3\u30b8\u30f3\u30fb\u74b0\u5883\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u3001\u300cUnexpected token\u300d\u4ee5\u5916\u306e\u8868\u73fe\u306b\u306a\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u30a8\u30e9\u30fc\u306b\u3064\u306a\u304c\u308b\u5165\u529b\u4f8b<\/th>\n<th>\u4e3b\u306a\u539f\u56e0<\/th>\n<th>\u78ba\u8a8d\u65b9\u6cd5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>{&#39;name&#39;:&#39;A&#39;}<\/td>\n<td>\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3067JSON\u6587\u5b57\u5217\u3092\u56f2\u3080<\/td>\n<td>JSON\u3067\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u304c\u5fc5\u8981<\/td>\n<\/tr>\n<tr>\n<td>{name:&quot;A&quot;}<\/td>\n<td>\u30d7\u30ed\u30d1\u30c6\u30a3\u540d\u306e\u5f15\u7528\u7b26\u304c\u306a\u3044<\/td>\n<td>&quot;name&quot;\u306e\u5f62\u5f0f\u306b\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>{&quot;name&quot;:&quot;A&quot;,}<\/td>\n<td>\u672b\u5c3e\u306e\u30ab\u30f3\u30de<\/td>\n<td>\u6700\u5f8c\u306e\u8981\u7d20\u306e\u76f4\u5f8c\u306e\u30ab\u30f3\u30de\u3092\u5916\u3059<\/td>\n<\/tr>\n<tr>\n<td>&lt;html&gt;&#8230;&lt;\/html&gt;<\/td>\n<td>HTML\u30ec\u30b9\u30dd\u30f3\u30b9\u3092JSON\u6271\u3044<\/td>\n<td>API\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3068\u672c\u6587\u7a2e\u985e\u3092\u8abf\u3079\u308b<\/td>\n<\/tr>\n<tr>\n<td>\u7a7a\u6587\u5b57\u5217<\/td>\n<td>\u89e3\u6790\u53ef\u80fd\u306aJSON\u5024\u304c\u306a\u3044<\/td>\n<td>\u30ec\u30b9\u30dd\u30f3\u30b9204\u306a\u3069\u3092\u533a\u5225\u3059\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p><strong>\u7528\u8a9e\u89e3\u8aac\uff1aSyntaxError<\/strong><br \/>JavaScript\u304c\u898f\u5b9a\u306e\u69cb\u6587\u3068\u3057\u3066\u8aad\u307f\u53d6\u308c\u306a\u3044\u3068\u304d\u306b\u51fa\u308b\u30a8\u30e9\u30fc\u578b\u3002JSON.parse\u3067\u306f\u53d7\u4fe1\u30c6\u30ad\u30b9\u30c8\u304cJSON\u6587\u6cd5\u306b\u5408\u308f\u306a\u3044\u5834\u5408\u306b\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<\/blockquote>\n<hr>\n<h2>\u624b\u98061\uff1a\u3069\u306e\u6587\u5b57\u5217\u3092parse\u3057\u3066\u3044\u308b\u304b\u7279\u5b9a\u3059\u308b<\/h2>\n<p>\u30a2\u30d7\u30ea\u306e\u3069\u3053\u3067JSON.parse\u304c\u547c\u3070\u308c\u305f\u304b\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u78ba\u8a8d\u3057\u3001\u76f4\u524d\u306b\u6e21\u3057\u305f\u5024\u306e\u7a2e\u985e\u3092\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3059\u3002\u5b9f\u30b5\u30fc\u30d3\u30b9\u3067\u306f\u5165\u529b\u672c\u6587\u3092\u305d\u306e\u307e\u307e\u30ed\u30b0\u3078\u51fa\u3059\u3068\u8a8d\u8a3c\u60c5\u5831\u30fb\u500b\u4eba\u60c5\u5831\u304c\u6df7\u3056\u308b\u3053\u3068\u304c\u3042\u308b\u305f\u3081\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<pre><code>function parseJsonSafely(raw) {\r\n  if (typeof raw !== &quot;string&quot;) {\r\n    throw new TypeError(&quot;JSON\u7528\u306e\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044&quot;);\r\n  }\r\n\r\n  try {\r\n    return JSON.parse(raw);\r\n  } catch (error) {\r\n    if (error instanceof SyntaxError) {\r\n      throw new Error(&quot;JSON\u5f62\u5f0f\u306e\u5165\u529b\u3067\u306f\u3042\u308a\u307e\u305b\u3093&quot;, {\r\n        cause: error\r\n      });\r\n    }\r\n    throw error;\r\n  }\r\n}<\/code><\/pre>\n<p>\u3053\u306e\u4f8b\u306f\u539f\u56e0\u3092\u5224\u5225\u3059\u308b\u5165\u53e3\u3067\u3059\u3002\u5b9f\u52d9\u3067\u306f\u3001\u5165\u529b\u7a2e\u5225\u30fb\u9577\u3055\u30fb\u51e6\u7406\u306e\u767a\u751f\u7b87\u6240\u306a\u3069\u3001\u6a5f\u5fae\u60c5\u5831\u3092\u542b\u307e\u306a\u3044\u60c5\u5831\u3092\u8a18\u9332\u3057\u3001\u672c\u6587\u5168\u4f53\u3092\u7121\u6761\u4ef6\u306b\u30ed\u30b0\u51fa\u529b\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<hr>\n<h2>\u624b\u98062\uff1aJSON\u6587\u6cd5\u3092\u898b\u76f4\u3059<\/h2>\n<p>\u6700\u3082\u4e00\u822c\u7684\u306a\u306e\u306f\u3001JavaScript\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u306f\u898b\u6163\u308c\u305f\u8a18\u6cd5\u3092JSON\u6587\u5b57\u5217\u3078\u4f7f\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u3067\u3059\u3002\u5c0f\u3055\u306a\u5165\u529b\u4f8b\u3067\u6bd4\u3079\u308b\u3068\u9055\u3044\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<pre><code>\/\/ JavaScript\u306e\u6587\u5b57\u5217\u3068\u3057\u3066\u6b63\u3057\u3044\u304cJSON\u3068\u3057\u3066\u306f\u4e0d\u6b63\r\nconst invalid = &quot;{&#39;name&#39;: &#39;A&#39;,}&quot;;\r\ntry {\r\n  JSON.parse(invalid);\r\n} catch (error) {\r\n  console.log(error instanceof SyntaxError); \/\/ true\r\n}\r\n\r\nconst valid = &#39;{&quot;name&quot;: &quot;A&quot;}&#39;;\r\nconsole.log(JSON.parse(valid).name); \/\/ A<\/code><\/pre>\n<p>JSON\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u540d\u3068\u6587\u5b57\u5217\u5024\u306f\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u3067\u56f2\u307f\u3001\u672b\u5c3e\u306e\u30ab\u30f3\u30de\u3092\u4ed8\u3051\u307e\u305b\u3093\u3002JavaScript\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30ea\u30c6\u30e9\u30eb\u3068JSON\u6587\u5b57\u5217\u306f\u540c\u3058\u6587\u6cd5\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u8aa4\u308a\u306e\u4f8b<\/th>\n<th>\u76f4\u3057\u65b9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u306e\u6587\u5b57\u5217<\/td>\n<td>JSON\u5185\u90e8\u3092\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u3078<\/td>\n<\/tr>\n<tr>\n<td>\u672b\u5c3e\u306e\u30ab\u30f3\u30de<\/td>\n<td>\u4f59\u8a08\u306a\u30ab\u30f3\u30de\u3092\u53d6\u308a\u9664\u304f<\/td>\n<\/tr>\n<tr>\n<td>undefined\u3084NaN<\/td>\n<td>JSON\u3068\u3057\u3066\u8a31\u3055\u308c\u308b\u5024\u3078\u5909\u63db\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>JavaScript\u30b3\u30e1\u30f3\u30c8<\/td>\n<td>\u30b3\u30e1\u30f3\u30c8\u3092\u9664\u53bb\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>\u8907\u6570\u306eJSON\u5024\u3092\u9023\u7d50<\/td>\n<td>1\u3064\u306eJSON\u30c7\u30fc\u30bf\u3068\u3057\u3066\u8a2d\u8a08\u3059\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr>\n<h2>\u624b\u98063\uff1a\u300cUnexpected token &lt;\u300d\u306a\u3089HTML\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u7591\u3046<\/h2>\n<p>API\u306eJSON\u3092\u53d7\u3051\u53d6\u308b\u3064\u3082\u308a\u304c\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u30fb404\u30da\u30fc\u30b8\u30fb\u30b5\u30fc\u30d0\u30fc\u30a8\u30e9\u30fc\u306eHTML\u3092\u53d7\u4fe1\u3057\u3066\u3044\u305f\u5834\u5408\u3001\u5148\u982d\u306b\u30bf\u30b0\u306e\u8a18\u53f7\u304c\u73fe\u308c\u3001JSON\u3068\u3057\u3066\u89e3\u6790\u3067\u304d\u307e\u305b\u3093\u3002\u30a8\u30e9\u30fc\u6587\u5b57\u5217\u306e\u300c&lt;\u300d\u306f\u4e00\u4f8b\u3067\u3042\u308a\u3001\u5fc5\u305a\u3053\u306e\u6587\u8a00\u306b\u306a\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre><code>const response = await fetch(&quot;\/api\/users&quot;);\r\n\r\nif (!response.ok) {\r\n  throw new Error(&quot;HTTP &quot; + response.status);\r\n}\r\n\r\nconst contentType = response.headers.get(&quot;content-type&quot;) ?? &quot;&quot;;\r\n\r\nif (!contentType.toLowerCase().includes(&quot;json&quot;)) {\r\n  throw new Error(&quot;JSON\u3067\u306a\u3044\u5fdc\u7b54\u304c\u8fd4\u308a\u307e\u3057\u305f&quot;);\r\n}\r\n\r\nconst data = await response.json();\r\nconsole.log(Array.isArray(data));<\/code><\/pre>\n<p>response.json()\u306e\u5185\u90e8\u3067\u3082JSON\u306e\u89e3\u6790\u304c\u884c\u308f\u308c\u307e\u3059\u3002\u8fd4\u3063\u3066\u304d\u305fHTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u3068Content-Type\u3092\u5148\u306b\u898b\u308b\u3053\u3068\u3067\u3001API\u304cJSON\u3067\u306f\u306a\u3044\u5fdc\u7b54\u3092\u8fd4\u3057\u305f\u539f\u56e0\u3092\u8abf\u3079\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002Content-Type\u306f\u81ea\u5df1\u7533\u544a\u306a\u306e\u3067\u3001JSON\u3068\u66f8\u304b\u308c\u3066\u3044\u3066\u3082\u672c\u6587\u307e\u3067\u6b63\u3057\u3044\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3053\u308c\u306fJSON\u5fdc\u7b54\u3092\u5fc5\u9808\u3068\u3059\u308bAPI\u5411\u3051\u306e\u30ac\u30fc\u30c9\u4f8b\u3067\u3059\u3002Content-Type\u304c\u7701\u7565\u3055\u308c\u305fAPI\u3084\u72ec\u81ea\u30e1\u30c7\u30a3\u30a2\u30bf\u30a4\u30d7\u3067\u306f\u3001\u5951\u7d04\u306b\u5408\u308f\u305b\u3066\u5224\u5b9a\u6761\u4ef6\u3092\u8abf\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u624b\u98064\uff1a204\u3084\u7a7a\u672c\u6587\u3092JSON.parse\u3078\u6e21\u3055\u306a\u3044<\/h2>\n<p>API\u304c204 No Content\u3092\u8fd4\u3057\u305f\u5834\u5408\u306f\u3001\u6b63\u5e38\u7d42\u4e86\u3067\u3082\u5fdc\u7b54\u672c\u6587\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u7a7a\u6587\u5b57\u306b\u5bfe\u3057\u3066JSON.parse\u3084response.json\u3092\u547c\u3076\u3068SyntaxError\u306b\u306a\u308b\u305f\u3081\u3001\u672c\u6587\u304c\u5fc5\u8981\u306aAPI\u304b\u3069\u3046\u304b\u3092\u5148\u306b\u5224\u65ad\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>async function loadItems() {\r\n  const response = await fetch(&quot;\/api\/items&quot;);\r\n\r\n  if (!response.ok) {\r\n    throw new Error(&quot;HTTP &quot; + response.status);\r\n  }\r\n\r\n  if (response.status === 204) {\r\n    return null;\r\n  }\r\n\r\n  const body = await response.text();\r\n\r\n  if (body.trim().length === 0) {\r\n    throw new Error(&quot;JSON\u672c\u6587\u304c\u7a7a\u3067\u3057\u305f&quot;);\r\n  }\r\n\r\n  return JSON.parse(body);\r\n}<\/code><\/pre>\n<p>\u4e00\u5ea6response.text()\u3067\u8aad\u3093\u3060\u672c\u6587\u306f\u3001\u540c\u3058Response\u304b\u3089\u3082\u3046\u4e00\u5ea6response.json()\u3067\u8aad\u3080\u3053\u3068\u306f\u901a\u5e38\u3067\u304d\u307e\u305b\u3093\u3002\u3069\u3061\u3089\u304b\u4e00\u65b9\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u4f8b\u306f\u7a7a\u672c\u6587\u3092\u5225\u306e\u30a8\u30e9\u30fc\u3078\u5207\u308a\u5206\u3051\u308b\u8a2d\u8a08\u3067\u3001\u5b9f\u969b\u306eAPI\u4ed5\u69d8\u306b\u5408\u308f\u305b\u3066null\u3084\u30a8\u30e9\u30fc\u3092\u9078\u3073\u307e\u3059\u3002<\/p>\n<h2>\u624b\u98065\uff1a\u69cb\u6587\u30a8\u30e9\u30fc\u3068\u30c7\u30fc\u30bf\u306e\u578b\u9055\u3044\u3092\u5206\u3051\u308b<\/h2>\n<p>JSON.parse\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u3051\u308c\u3070\u3001\u305d\u308c\u306f\u300c\u69cb\u6587\u3068\u3057\u3066\u6b63\u3057\u3044JSON\u3060\u3063\u305f\u300d\u3068\u3044\u3046\u610f\u5473\u3067\u3059\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306ename\u304c\u6587\u5b57\u5217\u3067\u3042\u308b\u3001items\u304c\u914d\u5217\u3067\u3042\u308b\u3001\u3068\u3044\u3063\u305f\u30a2\u30d7\u30ea\u56fa\u6709\u306e\u6761\u4ef6\u307e\u3067\u4fdd\u8a3c\u3057\u307e\u305b\u3093\u3002<\/p>\n<pre><code>const value = JSON.parse(&#39;{&quot;items&quot;: [1, 2, 3]}&#39;);\r\n\r\nif (\r\n  typeof value !== &quot;object&quot; ||\r\n  value === null ||\r\n  !Array.isArray(value.items)\r\n) {\r\n  throw new Error(&quot;items\u304c\u914d\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093&quot;);\r\n}\r\n\r\nconsole.log(value.items.length);<\/code><\/pre>\n<p>\u5229\u7528\u3059\u308b\u30c7\u30fc\u30bf\u304c\u5916\u90e8API\u7531\u6765\u306e\u5834\u5408\u306f\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u30b9\u30ad\u30fc\u30de\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30e9\u30a4\u30d6\u30e9\u30ea\u3084\u660e\u793a\u7684\u306a\u578b\u691c\u67fb\u3092\u5c0e\u5165\u3057\u3001\u69cb\u6587\u30c1\u30a7\u30c3\u30af\u3068\u30c7\u30fc\u30bf\u691c\u8a3c\u3092\u5206\u96e2\u3057\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u52d9\u3067\u591a\u3044\u539f\u56e0\u3068\u8a3a\u65ad\u9806<\/h2>\n<ul>\n<li>\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u30a8\u30e9\u30fc\u4f4d\u7f6e\u3068\u4f8b\u5916\u306e\u7a2e\u985e\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li>JSON.parse\u3078\u6e21\u3059\u5024\u304c\u6587\u5b57\u5217\u304b\u3001\u7a7a\u3067\u306a\u3044\u304b\u8abf\u3079\u308b\u3002<\/li>\n<li>JSON\u69cb\u6587\uff08\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u30fb\u30ab\u30f3\u30de\u30fb\u30b3\u30e1\u30f3\u30c8\u30fbundefined\uff09\u3092\u70b9\u691c\u3059\u308b\u3002<\/li>\n<li>API\u306e\u5834\u5408\u306fHTTP status\u3068Content-Type\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li>JSON\u3068\u3057\u3066\u89e3\u6790\u3067\u304d\u305f\u5f8c\u306f\u3001\u671f\u5f85\u3059\u308b\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u578b\u3092\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<\/ul>\n<p>API\u304c\u610f\u56f3\u305b\u305a\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3092\u8fd4\u3057\u305f\u5834\u5408\u306f\u3001\u901a\u4fe1\u5148URL\u3001\u8a8d\u8a3c\u5207\u308c\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3001\u30d7\u30ed\u30ad\u30b7\u8a2d\u5b9a\u3092\u8abf\u3079\u307e\u3059\u3002CORS\u306e\u5236\u7d04\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u81ea\u4f53\u3092\u53d7\u3051\u53d6\u308c\u306a\u3044\u5834\u5408\u306fJSON\u69cb\u6587\u4ee5\u524d\u306e\u554f\u984c\u3068\u3057\u3066\u6271\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u95a2\u9023\u3059\u308bJSON\u30fb\u975e\u540c\u671f\u901a\u4fe1\u306e\u8a18\u4e8b<\/h2>\n<p>JSON\u306e\u69cb\u6587\u3084\u30c7\u30fc\u30bf\u8a2d\u8a08\u3092\u5fa9\u7fd2\u3057\u305f\u3044\u5834\u5408\u306f\u65e2\u5b58\u306eJSON\u89e3\u8aac\u8a18\u4e8b\u3078\u9032\u3080\u3068\u7406\u89e3\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002API\u3068fetch\u306e\u57fa\u672c\u7684\u306a\u52d5\u304d\u3092\u78ba\u8a8d\u3059\u308b\u306a\u3089Ajax\u5165\u9580\u3082\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p>\uff08JSON\u6587\u6cd5\u3068\u30c7\u30fc\u30bf\u8a2d\u8a08\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1610\/\">JSON\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u57fa\u790e\u304b\u3089API\u9023\u643a\u30fb\u8a2d\u8a08\u539f\u5247\u30fb\u30a8\u30e9\u30fc\u89e3\u6c7a\u307e\u3067<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\uff08API\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u53d7\u3051\u53d6\u308b\u624b\u9806\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1128\/\">JavaScript\u306eAjax\u5b8c\u5168\u5165\u9580\uff5cfetch\u306e\u4f7f\u3044\u65b9\u30fbCORS\u30a8\u30e9\u30fc\u306e\u5bfe\u51e6\u30fb\u975e\u540c\u671f\u901a\u4fe1\u306e\u57fa\u672c\u3092\u89e3\u8aac<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<h2>\u3088\u304f\u3042\u308b\u8cea\u554f\u3068\u307e\u3068\u3081<\/h2>\n<h3>JSON.parse\u306e\u30a8\u30e9\u30fc\u306fJavaScript\u30a8\u30f3\u30b8\u30f3\u306b\u3088\u3063\u3066\u9055\u3044\u307e\u3059\u304b\uff1f<\/h3>\n<p>\u306f\u3044\u3002\u30a8\u30e9\u30fc\u6587\u8a00\u3084\u4f4d\u7f6e\u8868\u793a\u306f\u74b0\u5883\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002\u307e\u305aSyntaxError\u3067\u3042\u308b\u3053\u3068\u3068\u6e21\u3057\u305f\u5165\u529b\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>JSON.parse\u3067\u69cb\u6587\u304c\u6b63\u3057\u3051\u308c\u3070\u578b\u691c\u67fb\u306f\u4e0d\u8981\u3067\u3059\u304b\uff1f<\/h3>\n<p>\u4e0d\u8981\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3002JSON\u3068\u3057\u3066\u6709\u52b9\u3067\u3082\u3001\u671f\u5f85\u3059\u308b\u69cb\u9020\u3084\u578b\u3068\u4e00\u81f4\u3059\u308b\u304b\u306f\u5225\u306b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<h3>fetch\u306f\u6210\u529f\u306a\u306e\u306bJSON.parse\u3067\u843d\u3061\u308b\u306e\u306f\u306a\u305c\uff1f<\/h3>\n<p>HTTP\u901a\u4fe1\u306b\u6210\u529f\u3057\u3066\u3082\u3001\u672c\u6587\u304cHTML\u3001\u7a7a\u3001\u307e\u305f\u306f\u69cb\u6587\u4e0d\u6b63\u306aJSON\u306a\u3089\u89e3\u6790\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002status\u3001Content-Type\u3001\u672c\u6587\u306e\u5f62\u5f0f\u3092\u9806\u306b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>JSON.parse\u306eUnexpected token\u306f\u3001\u53d7\u4fe1\u30c7\u30fc\u30bf\u3092JSON\u6587\u6cd5\u3068\u3057\u3066\u89e3\u91c8\u3067\u304d\u306a\u3044\u3053\u3068\u3092\u77e5\u3089\u305b\u308b\u30a8\u30e9\u30fc\u306e\u4e00\u7a2e\u3067\u3059\u3002\u5165\u529b\u306e\u7a2e\u985e\u3001\u6587\u6cd5\u3001HTTP\u30ec\u30b9\u30dd\u30f3\u30b9\u3001\u7a7a\u672c\u6587\u3001\u30b9\u30ad\u30fc\u30de\u3092\u5206\u3051\u3066\u78ba\u8a8d\u3059\u308b\u3068\u539f\u56e0\u306b\u8fd1\u3065\u3051\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u5834\u6240\u306eJSON.parse\u306e\u5f15\u6570\u3092\u78ba\u8a8d\u3057\u3001API\u306e\u5834\u5408\u306f\u30b9\u30c6\u30fc\u30bf\u30b9\u3068Content-Type\u304b\u3089\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"featured_media":6486,"template":"","meta":{"ssp_meta_title":"JSON.parse\u306eUnexpected token\u30a8\u30e9\u30fc\uff5c\u539f\u56e0\u3068\u8a3a\u65ad\u624b\u9806","ssp_meta_description":"JSON.parse\u306eUnexpected token\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b\u624b\u9806\u3002JSON\u6587\u6cd5\u3001\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8\u3001\u672b\u5c3e\u30ab\u30f3\u30de\u3001API\u306eHTML\u5fdc\u7b54\u3001204\u3084\u7a7a\u672c\u6587\u3092\u5206\u3051\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002","ssp_meta_keyword":"JavaScript JSON.parse Unexpected token \u30a8\u30e9\u30fc,JSON.parse SyntaxError \u539f\u56e0,JSON.parse Unexpected token &lt;,JSON.parse \u672b\u5c3e\u30ab\u30f3\u30de,JSON.parse HTML \u30ec\u30b9\u30dd\u30f3\u30b9,response.json 204","ssp_meta_canonical":""},"route_category":[9],"_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/6485"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/6486"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=6485"}],"wp:term":[{"taxonomy":"route_category","embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route_category?post=6485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}