DESARROLLADORhttp://apps.facebook.com/developer
¡Creemos el directorio de nuestra aplicación!
PHP Genius¿Cómo inicio?	<?php ...                  ?>¿Cómo se declaran las variables?	$variable1=0;	$variable2="esto es una cadena";¿Cómo imprimo en pantalla?	echo $variable1;	echo "esto es una cadena";¿Cómo comento?	//   para una línea	 /* */ para varias líneas
PHP Genius¿Cómo se incluyen páginas externas?require_once 'carpeta/archivo.php';¿Cómo concateno cadenas?	$cadena = “hola”.”mundo”;Comillas dentro de cadenas de caracteres	$cadena = “hola \” mundo \”   ”;Arrays asociados	$color = array (‘rojo’=>45, ‘verde’=>67, ‘azul’=>32);	$variable = $color[‘rojo’];foreach ($color as $valor)		echo “$valor ”;
FBML
FBML
<fb:nameuid=“UN USER ID" /><fb:profile-picuid=“UN USER ID" linked="true"size=“small"/>
<fb:dashboard><fb:actionhref=“index.php”title="Home"> Home  </fb:action>      <fb:helphref="ayuda.php”title=“Help“>Help  </fb:help><fb:create-buttonhref="invite.php“>  Invitar </fb:create-button></fb:dashboard>
<fb:wall>	<fb:wallpost  t=“1" uid="520602768">FacebookRocks!	</fb:wallpost></fb:wall>
TabEffect<fb:tabs><fb:tab-itemhref=“index.php”  title="Hello " selected="true"/>    <fb:tab-itemhref=“invite.php"title="Invite Your Friends"/></fb:tabs>
fb:success
fb:error
<fb:message> 	This is the heading text for the message. </fb:message><fb:success> 	<fb:message>Success message</fb:message> 	This is the success message text. </fb:success><fb:error>	<fb:message>Error message</fb:message> 	Este es el cuerpo</fb:error>
Dialogs<fb:dialog id="fb_search" cancel_button="true">	<fb:dialog-title>.. TrabelingBabies</fb:dialog-title>	<fb:dialog-content><fb:message>Este es el cuerpo</fb:message></fb:dialog-content></fb:dialog><a href="" clicktoshowdialog="fb_search">Mostrar Error</a>
FBJS
Includingscrpits<script src=http://midominio/miProyecto/externo.js?version=1.0></script><script >//some scripts	//..</script>
ManipulatingStylesobj.setStyle({color: 'black', background: 'white'});obj.setStyle('color', 'black');obj.setStyle('textDecoration', 'underline');obj.setStyle('text-decoration', 'underline');obj.setStyle('width', '340px');obj.setStyle('width', '340');setStyle('left', x), butratherlikesetStyle('left', x+'px').
ManipulatingStylesaddClassName(className) ;removeClassName(className) ;toggleClassName(className); hasClassName(className) ;
Creating FBML ElementsvarnewSwf = document.createElement('fb:swf'); Eventscan beaddedto FBJS DOM objectsusingthe W3C-style addEventListener method.ThirdparameteruseCaptureisnotsupported. listEventListeners(eventName) purgeEventListeners(eventName) stopPropagation preventDefault Events
echo "<style>";echohtmlentities(file_get_contents('estilo.css',true)); echo "</style>";<div id="foo">bar</div>#foo { ... }<div id="app0123456789_foo">bar</div>#app0123456789_foo { ... }
Default CSS properties for elements on a Facebook canvas page<body/>, <p/>       font-family: lucida grande, tahoma, verdana, arial, sans-serif; font-size: 11px<h1/> 	            color: #333; font-size: 14px<h2/>, <h3/>         color: #333; font-size: 13px<h4/>, <h5/>         color: #333; font-size: 11px<a/> 	            color: #3B5998; text-decoration: nonea:hover 	             text-decoration: underline<img/>                    border: 0px none<select/>                border: 1px solid #BDC7D8<input/>                  border-color: #ADADAD; border-style: solid; border-width: 1px
do_colors!functiondo_colors(obj) { obj.setStyle({background: 'black', color: 'red'}); } <a href="#" onclick="do_colors(this); return false">Hello World!</a>
new Ajax();responseType This can beone of Ajax.RAW, Ajax.JSON, orAjax.FBML. ondone(data) onerror And twomethods: post(url, query) Startan AJAX post. urlmustbe a remoteaddress, and query can beeither a stringoranobjectthatisautomaticallyconvertedto a string. abort() 
<script>functiondo_ajax(url, div_id) {varajax = new Ajax();ajax.responseType = Ajax.FBML;ajax.ondone = function(data) {document.getElementById(div_id).setInnerFBML(data);}ajax.requireLogin = true;ajax.post(url);}</script>
MockAJAX’d
MOCK AJAX<form id="dummy_form“></form> 	<a clickrewriteurl='http://your_server/ajax.php' clickrewriteform='dummy_form' 	clickrewriteid=‘your_div'>refreshcontent</a> <div id=“your_div"> </div>
Selectingmultiplefriends<fb:multi-friend-input width="350px" border_color="#8496ba" exclude_ids="4,5,10,15" /><input type="hidden" value="123456789" name="ids[]"/>$friends = (isset($_REQUEST["ids"]) ? $_REQUEST["ids"] : null);
PUBLIQUEMOS!<script>function publique(){varattachment = {'media':[{'type':'image','src':‘URL_IMAGEN','href':‘URL_REF'}]}; Facebook.streamPublish('Esto es lo que te publico', attachment);}</script>
Facebook app API Vs2.0

Facebook app API Vs2.0