Accessing the DOM Behind FBJS
Problem
I need to see the actual DOM object that’s behind an FBJS variable, but I can’t figure out any way to get to it.
Solution and Discussion
Install Firebug (see Use Firebug (No, Seriously) for more
information), and then add a call to console.dir(
obj
)
on your object. Firebug will give you a
long listing of all of the functions that FBJS has added to your
object (starting with things such as addClassName()
, addEventListener()
, appendChild()
, etc.), at the very top of
which you will find a PRIV_obj
entry. If you open that up, you’ll see the actual DOM object hiding
behind the ultimate FBJS representation.
Get Facebook Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.