2013-04-29 70 views
0

我遇到了一些问题。首先,iframe只会呈现“名称”字段,而不会呈现其他字符,即使那些不是自定义的字段。我读了一些关于fb:registraiton标签可能会更好地用于自定义字段的问题,但我不知道如何使用这些工作,因为我找不到使用自定义字段的任何示例。这是我的代码:facebook注册插入自定义字段不起作用

<iframe src="https://www.facebook.com/plugins/registration? 
      client_id=39672055*******& 
      redirect_uri=http://mydomain.com/signedRequest.php&fb_only=true&fields="[ 
{'name':'name'}, //only the name field will render 
{'name':'email'}, 
{'name':'location'}, 
{'name':'gender'}, 
{'name':'password'}, 
{'name':'neighborhood','description':'In What Neighborhood Do you Live?','type':'text', 'view':'prefilled'} 
]" 
     scrolling="auto" 
     frameborder="no" 
     style="border:none" 
     allowTransparency="true" 
     width="100%" 
     height="330"> 
</iframe> 

回答

0

我从另一个堆栈问题找到了这个解决方案。对于我来说,这个问题似乎是在字段属性的开始大括号之前的开头引号。该语法的工作原理如下:

<iframe src="https://www.facebook.com/plugins/registration.php? 
     client_id=MY_APP_ID& 
     redirect_uri=MY_CALLBACK_URL& 
     fields=[ 
       { 'name':'name' }, 
       { 'name':'first_name' }, 
       { 'name':'last_name' }, 
       { 'name':'company', 'description':'Company Name', 'type':'text' }, 
       { 'name':'email' }, 
       { 'name':'phone', 'description':'Phone Number', 'type':'text' }, 
       { 'name':'address1', 'description':'Address', 'type':'text' }, 
       { 'name':'city', 'description':'City', 'type':'text' }, 
       { 'name':'state', 'description':'State/Region', 'type':'text' }, 
       { 'name':'zip', 'description':'Zip Code', 'type':'text' } 
       ]" 
     scrolling="auto" 
     frameborder="no" 
     style="border:none" 
     allowTransparency="true" 
     width="100%" 
     height="600"> 
</iframe>