0

我得到的错误是:无法解析字段属性。它是 JSON 数组还是 CSV 列表?

问题出在表单中包含的选择菜单中。我想要实现的是这个链接上显示的选择框:注册插件

但不知何故,问题是没有显示选择框!

<iframe src='http://www.facebook.com/plugins/registration.php?
                    client_id=325340244194060&
                    redirect_uri=http://www.pingcampus.com/facebook_registration_plugin/store_user_data.php&
                    fields=[
                    {"name":"name"},
                    {"name":"email"},
                    {"name":"gender"},
                    {"name":"birthday"},

                    {'name':'captain',    'description':'Best Captain',             'type':'select',    'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}}


                    {'name':'captain',    'description':'College','type':'select','options':


                    {'P':'Jean-Luc Picard','K':'James T. Kirk',                                         
                    '1':'Acropolis','2':'Astral','3':'Aurobindo','4':'BM','5':'Central','6':'Chameli','7':'IET (DAVV)','8':'IIST
     ','9':'IIST2
     ','10':'IPS
     ','11':'JDCT
     ','12':'KCB
     ','13':'LKCT
     ','14':'LNCT
     ','15':'MIT (Malwa)
     ','16':'Malwa (Malwa2)
     ','17':'Mandsaur
     ','18':'Mathuradevi
     ','19':'MITM (Medi1)
     ','20':'MIST (Medi2)
     ','21':'MGIEM
     ','22':'Nalin
     ','23':'Oriental
     ','24':'Patel
     ','25':'Prestige
     ','26':'Priyatam
     ','27':'Rishiraj
     ','28':'RKDF
     ','29':'Royal
     ','30':'Sanghvi
     ','31':'Sdbansal
     ','32':'SGSITS
     ','33':'SIMS
     ','34':'SKSITS
     ','35':'Star
     ','36':'SVCE
     ','37':'SVITS
     ','38':'Transnational
     ','39':'Truba
     ','40':'Venkateshwar
     ','41':'Vidhyasagar
     ','42':'Vikrant
     ','43':'Vindhya
     ','#':'--------------------------------
     ','#':'Commerce
     ','#':'--------------------------------
     ','44':'Acro
     ','45':'Apex
     ','46':'Arihant
     ','47':'BM
     ','48':'Chamelidevi
     ','49':'Chimc
     ','50':'Choithram
     ','51':'Christian
     ','52':'DCBS (Daly College)
     ','53':'IBMR
     ','54':'IIMR (IIST)
     ','55':'IIPS (DAVV)
     ','56':'Ilva
     ','57':'IMIR
     ','58':'Imperial
     ','59':'IMS (DAVV)
     ','60':'Islamia
     ','61':'JDCT
     ','62':'LKCT
     ','63':'LNCT
     ','64':'Maharaja
     ','65':'MIT (Malwa)
     ','66':'Mathuradevi
     ','67':'Matushri
     ','68':'MBKhalsa
     ','69':'Medicaps
     ','70':'Patel
     ','71':'Pioneer
     ','72':'Prestige
     ','73':'Priyatam
     ','74':'Renaissance
     ','75':'Rishiraj
     ','76':'Sahib
     ','77':'SAIMS
     ','78':'Sanghvi Innovative
     ','79':'Sapient
     ','80':'SGSITS
     ','81':'SIMS
     ','82':'SJDM
     ','83':'SKSITS
     ','84':'Softvision
     ','85':'SVCE
     ','86':'Rransnational
     ','87':'Vaishnav
     ','88':'Venkteshwar
     ','89':'Vidhyasagar
     ','90':'Vikrant
     ','#':'--------------------------------
     ','#':'Pharmacy
     ','#':'--------------------------------
     ','91':'Acropolis
     ','92':'Aurobindo
     ','93':'BM
     ','94':'Central
     ','95':'SOPE (DAVV)
     ','96':'IIP(IIST)
     ','97':'IPS
     ','98':'Oriental
     ','99':'Rishiraj
     ','100':'RKDF
     ','101':'Safe
     ','102':'SGSITS
     ','103':'Smriti (SCOPE) 
     ','104':'svce
     ','105':'vikrant
     ','#':'--------------------------------
     ','#':'Medical
     ','#':'--------------------------------
     ','106':'Arihant
     ','107':'Bombay Hospital
     ','108':'Index
     ','109':'MGMMC
     ','110':'RD Memorial
     ','111':'Shubhdeep
     ','#':'--------------------------------
     ','#':'Dental
     ','#':'--------------------------------
     ','112':'Aurobindo
     ','113':'CDSH
     ','114':'GCD
     ','115':'Index
     ','116':'Modern
     ','#':'--------------------------------
     ','#':'Arts
     ','#':'--------------------------------
     ','117':'BIG Aims
     ','118':'Frameboxx
     ','119':'INIFD
     ','120':'MAAC
     ','121':'SDPS
     ','122':'SJMC (DAVV)
     ','123':'Virtual Voyage
     ','124':'Zica
     ','132':'EMRC (DAVV) 
     ','#':'--------------------------------
     ','#':'Architecture
     ','#':'--------------------------------
     ','125':'IPS
     ','126':'SDPS
     ','#':'--------------------------------
     ','#':'Law
     ','#':'--------------------------------
     ','127':'Christian
     ','128':'SOL(DAVV)
     ','129':'IIL
     ','130':'Vaishnav'}       },

                    {"name":"Arts","description":"Arts","type":"checkbox","value":"Arts"},
                    {"name":"Act","description":"Act","type":"checkbox","value":"Act"},
                    {"name":"Cooking","description":"Cooking","type":"checkbox","value":"Cooking"},
                    {"name":"Dance","description":"Dance","type":"checkbox","value":"Dance"},
                    {"name":"Designing","description":"Designing","type":"checkbox","value":"Designing"},
                    {"name":"Fashion","description":"Fashion Designing","type":"checkbox","value":"Fashion Designing"},
                    {"name":"Interior","description":"Interior Designing","type":"checkbox","value":"Interior Designing"},
                    {"name":"Modeling","description":"Modeling","type":"checkbox","value":"Modeling"},
                    {"name":"Photography","description":"Photography","type":"checkbox","value":"Photography"},
                    {"name":"Poetry","description":"Poetry / Writing","type":"checkbox","value":"Poetry / Writing"},
                    {"name":"Programming","description":"Programming","type":"checkbox","value":"Programming"},
                    {"name":"Reading","description":"Reading","type":"checkbox","value":"Reading"},
                    {"name":"Sketching","description":"Sketching / Drawing","type":"checkbox","value":"Sketching / Drawing"},
                    {"name":"Singing","description":"Singing","type":"checkbox","value":"Singing"},
                    {"name":"Sports","description":"Sports","type":"checkbox","value":"Sports"},
                    {"name":"Stunting","description":"Stunting","type":"checkbox","value":"Stunting"},
                    {"name":"Videography","description":"Checkthis","type":"checkbox","value":"Videography"},
                    {"name":"Other","description":"Other","type":"checkbox","value":"Other"},
                    {"name":"captcha"}
                    ]'
                    scrolling="auto"
                    frameborder="no"
                    style="border:none"
                    allowTransparency="true"
                    width="500"
                    height="800"

     >
            </iframe>
4

2 回答 2

3

尝试用有效的 JSON 替换 fields=[....]

[
{
    "name": "name"
},
{
    "name": "email"
},
{
    "name": "gender"
},
{
    "name": "birthday"
},
{
    "name": "captain",
    "description": "BestCaptain",
    "type": "select",
    "options": {
        "P": "Jean-LucPicard",
        "K": "JamesT.Kirk"
    }
},
{
    "name": "captain",
    "description": "College",
    "type": "select",
    "options": {
        "1": "Acropolis",
        "2": "Astral",
        "3": "Aurobindo",
        "4": "BM",
        "5": "Central",
        "6": "Chameli",
        "7": "IET(DAVV)",
        "8": "IIST",
        "9": "IIST2",
        "10": "IPS",
        "11": "JDCT",
        "12": "KCB",
        "13": "LKCT",
        "14": "LNCT",
        "15": "MIT(Malwa)",
        "16": "Malwa(Malwa2)",
        "17": "Mandsaur",
        "18": "Mathuradevi",
        "19": "MITM(Medi1)",
        "20": "MIST(Medi2)",
        "21": "MGIEM",
        "22": "Nalin",
        "23": "Oriental",
        "24": "Patel",
        "25": "Prestige",
        "26": "Priyatam",
        "27": "Rishiraj",
        "28": "RKDF",
        "29": "Royal",
        "30": "Sanghvi",
        "31": "Sdbansal",
        "32": "SGSITS",
        "33": "SIMS",
        "34": "SKSITS",
        "35": "Star",
        "36": "SVCE",
        "37": "SVITS",
        "38": "Transnational",
        "39": "Truba",
        "40": "Venkateshwar",
        "41": "Vidhyasagar",
        "42": "Vikrant",
        "43": "Vindhya",
        "44": "Acro",
        "45": "Apex",
        "46": "Arihant",
        "47": "BM",
        "48": "Chamelidevi",
        "49": "Chimc",
        "50": "Choithram",
        "51": "Christian",
        "52": "DCBS(DalyCollege)",
        "53": "IBMR",
        "54": "IIMR(IIST)",
        "55": "IIPS(DAVV)",
        "56": "Ilva",
        "57": "IMIR",
        "58": "Imperial",
        "59": "IMS(DAVV)",
        "60": "Islamia",
        "61": "JDCT",
        "62": "LKCT",
        "63": "LNCT",
        "64": "Maharaja",
        "65": "MIT(Malwa)",
        "66": "Mathuradevi",
        "67": "Matushri",
        "68": "MBKhalsa",
        "69": "Medicaps",
        "70": "Patel",
        "71": "Pioneer",
        "72": "Prestige",
        "73": "Priyatam",
        "74": "Renaissance",
        "75": "Rishiraj",
        "76": "Sahib",
        "77": "SAIMS",
        "78": "SanghviInnovative",
        "79": "Sapient",
        "80": "SGSITS",
        "81": "SIMS",
        "82": "SJDM",
        "83": "SKSITS",
        "84": "Softvision",
        "85": "SVCE",
        "86": "Rransnational",
        "87": "Vaishnav",
        "88": "Venkteshwar",
        "89": "Vidhyasagar",
        "90": "Vikrant",
        "91": "Acropolis",
        "92": "Aurobindo",
        "93": "BM",
        "94": "Central",
        "95": "SOPE(DAVV)",
        "96": "IIP(IIST)",
        "97": "IPS",
        "98": "Oriental",
        "99": "Rishiraj",
        "100": "RKDF",
        "101": "Safe",
        "102": "SGSITS",
        "103": "Smriti(SCOPE)",
        "104": "svce",
        "105": "vikrant",
        "106": "Arihant",
        "107": "BombayHospital",
        "108": "Index",
        "109": "MGMMC",
        "110": "RDMemorial",
        "111": "Shubhdeep",
        "112": "Aurobindo",
        "113": "CDSH",
        "114": "GCD",
        "115": "Index",
        "116": "Modern",
        "117": "BIGAims",
        "118": "Frameboxx",
        "119": "INIFD",
        "120": "MAAC",
        "121": "SDPS",
        "122": "SJMC(DAVV)",
        "123": "VirtualVoyage",
        "124": "Zica",
        "125": "IPS",
        "126": "SDPS",
        "127": "Christian",
        "128": "SOL(DAVV)",
        "129": "IIL",
        "130": "Vaishnav",
        "132": "EMRC(DAVV)",
        "P": "Jean-LucPicard",
        "K": "JamesT.Kirk",
        "#": "--------------------------------"
    }
},
{
    "name": "Arts",
    "description": "Arts",
    "type": "checkbox",
    "value": "Arts"
},
{
    "name": "Act",
    "description": "Act",
    "type": "checkbox",
    "value": "Act"
},
{
    "name": "Cooking",
    "description": "Cooking",
    "type": "checkbox",
    "value": "Cooking"
},
{
    "name": "Dance",
    "description": "Dance",
    "type": "checkbox",
    "value": "Dance"
},
{
    "name": "Designing",
    "description": "Designing",
    "type": "checkbox",
    "value": "Designing"
},
{
    "name": "Fashion",
    "description": "Fashion Designing",
    "type": "checkbox",
    "value": "Fashion Designing"
},
{
    "name": "Interior",
    "description": "Interior Designing",
    "type": "checkbox",
    "value": "Interior Designing"
},
{
    "name": "Modeling",
    "description": "Modeling",
    "type": "checkbox",
    "value": "Modeling"
},
{
    "name": "Photography",
    "description": "Photography",
    "type": "checkbox",
    "value": "Photography"
},
{
    "name": "Poetry",
    "description": "Poetry / Writing",
    "type": "checkbox",
    "value": "Poetry / Writing"
},
{
    "name": "Programming",
    "description": "Programming",
    "type": "checkbox",
    "value": "Programming"
},
{
    "name": "Reading",
    "description": "Reading",
    "type": "checkbox",
    "value": "Reading"
},
{
    "name": "Sketching",
    "description": "Sketching / Drawing",
    "type": "checkbox",
    "value": "Sketching / Drawing"
},
{
    "name": "Singing",
    "description": "Singing",
    "type": "checkbox",
    "value": "Singing"
},
{
    "name": "Sports",
    "description": "Sports",
    "type": "checkbox",
    "value": "Sports"
},
{
    "name": "Stunting",
    "description": "Stunting",
    "type": "checkbox",
    "value": "Stunting"
},
{
    "name": "Videography",
    "description": "Checkthis",
    "type": "checkbox",
    "value": "Videography"
},
{
    "name": "Other",
    "description": "Other",
    "type": "checkbox",
    "value": "Other"
},
{
    "name": "captcha"
}
]
于 2012-05-02T10:02:40.280 回答
1

fields的注册社交插件参数包含无效的 JSON 对象(JSON 应使用双引号而不是单引号),并且您在,数组中间缺少(逗号),在下一行之后:

{'name':'captain', 'description':'Best Captain', 'type':'select', 'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}}

更新:
实际上,即使只使用有效的 JSON 在这种情况下也可能不起作用,因为这是作为查询字符串参数传递的,因此应该正确编码 JSON 以避免出现问题。也可能导致一些问题。

此外,您还有两个fields名为“船长”(这也会导致注册插件出现问题)。

在这里我创建了一些示例(由于大量的字段代码,我不把它们放在这里):

于 2012-05-02T10:05:14.337 回答