/    Sign up×
Community /Pin to ProfileBookmark

display random quotes using fbjs instead of jquery

i’ve made an app in php/mysql which generates random quotes at intervals. i’m trying to integrate it with facebook. if i use iframes, everything works smoothly except for one issue, that facebook doesn’t support iframe in profile boxes – which is what i want.

for this reason, i prefer to use fbml. however, i’m using jquery to get the quotes from the php file, and this doesn’t work in fbml. i read that with fbml, i can work with fbjs. since i do not know fbjs, i’m stuck.

how do i convert the jquery code to get the quotes from php to fbjs? specifically, which part from the jquery file do i need to convert to fbjs, to get my code to work using fbjs?

any help would be appreciated.

i tried using fbjqry, but it didn’t work.

this is my code:

[CODE]
<!DOCTYPE html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<link rel=”stylesheet” type=”text/css” href=”css/jquote.css” />
<!–<script type=”text/javascript” src=”scripts/jquery-1.4.2.js”></script>–>
<script type=”text/javascript” src=”fbjqry/utility.js”></script>
<script type=”text/javascript” src=”fbjqry/fjqry.js”></script>
<script type=”text/javascript”>
// On page load, fill the box with content.
$(document).ready(function() {
$(“#quoteContainer”).load(“quote.php”);
});

var auto_refresh = setInterval(
function ()
{
$(‘#quoteContainer’).load(‘quote.php’);
}, 5000); // refresh every 10000 milliseconds
</script>

</head>

<div id=”wrapper”>
<div class=”header”> Quote of the Day</div>
<div id=”quoteContainer”>
</div>
</div>

</html>
[/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @name_space spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...