fbjs

Best IDE for Facebook apps (FMBL and FBJS support)

I have a reasonable workflow for developing an iFrame app for Facebook. It's reasonable because I can test the app on localhost with a local Apache in any one of a myriad of IDEs that support HTML, CSS, and JavaScript (Visual Web Developer, NetBeans, Komodo, Aptana). But what if I want to develop a non-iFrame app with FBML? Is there an ...

JavaScript tree functionality without framework

I'd like to display a tree on a Facebook page with JavaScript. Therefore there can be no dependencies on frameworks such as jQuery or Ext which won't run on Facebook, at least as far as I know when I last worked on that platform (April 2009). Can anybody recommend a "framework-free" JavaScript/tree library? I have ported some fairly c...

Why does my setTimeout speed up when I have multiple tabs open to my site?

I have a timer that counts down every second. It works great until the user opens up 3 or 4 tabs of the my site, at which point the newest tab's timer goes double or triple speed. I can currently only reproduce the bug in IE8. I was previously using setInterval, and could reproduce the bug in Firefox as well. I'm actually using FBJS (...

Using FBJS to change CSS

I'm a bit stumped by the Facebook implementation of Javascript. I want to set up a listener on a checkbox so that when checked, it changes the class of an element I can get by ID. I've been using the test console and have tried various permutations. Javascript is NOT my first language, nor my second, third... COuld anyone help me by tra...

Facebook connect in iframe- popups shows inside the iframe

I'm implementing Facebook connect for a website. The facebook connect code is inside an iframe. Everything works well but when Facebook is supposed to show a popup dialog (for example FB.Connect.showFeedDialog or FB.Connect.streamPublish) The popup shows inside the iframe. Since its a small iframe window the popup is half hidden. Any i...

How can I use FBJS to prompt users to post feed in facebook?

Tried sth like below and nth happens.. <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> <script type="text/javascript"> FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("<?=$apiKey?>", "channel/xd_receiver.htm"); var api = FB.Facebook.apiCli...

Facebook form post data not present on backend

I am attempting to post form data to my app using Facebook. My form is integrated with a dialog and I am using form.submit() to submit the form. Please see my code. The post data does not appear on the backend (e.g. load-cargo-radio, city-id, train-id), but the fb_sig* data does. Does anyone know if there are any caveats regarding postin...

Can I get some help decoding this bit of a Facebook page?

Hi, I'm trying to figure out just how a particular function works on a Facebook page, and being no friend of JS syntax, am having trouble. Here's the question mark bit: <a href="#" clicktoshowdialog="my_dialog" onclick=" (new Image()).src = '/ajax/ct.php?app_id=4949752878&action_type=3&post_form_id=3b933f46f9c4c44981e51b90c754bfce&...

Extending prototypejs toggle() for effects

Is there a way to extend the toggle method in prorotypejs to allow for injection of an effect function, eg, scriptaculous effects or FBJS ...

get facebook user session after it over

hey i am using facebook connect and authenticate the user with it. for each user there is session key that expire after X minutes. how can i get the user session after the session is over ? i try FB.Connect.requireSession(); but i dont want to use this function because it pops up the facebook connect username and password. i wan...

Facebook tab application scripting

I have a web application that I am trying to port to Facebook. The app uses a few external javascript files. So initially I wanted to create an iframe Facebook application. However, it turns out that you cannot use iframes when creating a tab application(which is a requirement). By tab application I mean placing your app on the profile p...

FBJS textarea countdown

I have a textarea element in a Facebook application I want to limit, visually, to a certain number of characters. This is a code snippet I got from the web: <script> function textCounter(textarea, countdown, maxlimit) { textareaid = "ta1"; if (textareaid.value.length > maxlimit) textareaid.value = textareaid.value.s...

Facebooker Connect and Safari 4

Hi, Seems to be a known problem, but I didn't find the solution. When your facebook app tries to perform some JS call via loading fb:iframe with JS code, Safari blocks this saying "Unsafe JavaScript attempt to access frame with URL from frame with URL . Domain, names and protocols must match". Is there a way to solve this? ...

how to check special permissions in facebook

hey how can i check in javascript if user has granted my site the publish stream permission ? ...

Why is FBJS dropping my 'onclick' attribute from this input element?

When I include an 'onClick' attribute in setInnerXTHML() like this: var innerHtml = '<span>Build Track: Select a city where track building should begin'+ '<div id="action-end">'+ '<form>'+ '<input type="button" value="End Track Building" id="next-phase" onClick="moveTrainAuto();" />'+ ...

Facebook FBJS UTC

I am pulling in data from a JSON file using FBJS AJAX. On of the values in the json file is a date. The date has a UTC format, Date(1255535021000-0600). However, I am getting an "invalid date" or "NaN" error whatever I do. I have tried the following: new Date(1255535021000-0600), new Date(1255535021000), Date.parse(1255535021000-0600),...

addEventListener() question/weird behavior

I'm developing a game for Facebook. I'm using PHP and FBJS. I'm using addEventListener() to attach events to two buttons. Each button has it's own event handler which is a js function. The first event handler (loadNewCargo()) gets called with no problems. But the second event handler (discardExistingCargo()) causes the page to refresh wh...

addEventListener() attached to multiple buttons, but only fires once

I am writing a Facebook app in PHP/FBJS. I have some code where I attach an addEventListener() to two buttons. When I run the app, the first button I click on fires the addEventListener() and the event handler is invoked as expected. But if I click on the second button or click on the same button again, the event handler is not invoked. ...

Need some help synch'ing outer loop counter with dialog.onconfirm()

I am writing a game for Facebook. IN the following code, I have a problem. I have a for loop executing, and in that loop, I call a dialog and implement 'onconfirm' for the dialog. The problem is that I need to access th e loop counter inside of the onconfirm function. But because the onconfirm is called outside of the scope of the for lo...

facebook - using FBJS in iframe applications

Hi all, I am trying to use FBJS in my iframe app. Nothing that I write seems to work. Any ideas? ...