0
我想知道如何从JavaScript文件中提取JSON数据。 javascript旨在用作配置文件并包含一个带有JSON数据的变量。这与Magento 2中使用的require-config.js文件类似,仅供参考。它看起来是这样的:如何解析包含存储在变量中的json数据的JavaScript文件?
var config = {
fieldsets : [
{
title : 'Quote Essentials',
description : 'Some',
fields : [
{
label : 'What type of project is this for?',
required : true,
class : '',
type : 'input',
inputType : 'text',
hint : 'For example: company uniforms, clothing line, school events, etc.',
id : ''
},
{
label : 'How many total items do you need?',
required : true,
class : '',
type : 'input',
inputType : 'text',
hint : 'Please note: the minimum order size is 24 pieces.',
id : ''
},
...
这不是JSON。 – Xufox
我知道,它是一个包含json数据的变量的JavaScript文件。 –
你需要从哪里提取?在浏览器中?在服务器上? – Dmitry