Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

From the flair page, it is mentioned that it is available in JSON format. How can I use its response for my website similar to the JSONP example? If it's not possible, why?

share|improve this question

Hm... you mean like server-side?

Here's some code in PHP that does the equivilant of the JSON example:

$flair_json_url = '';
$flair_data = json_decode(file_get_contents($flair_json_url));
<div id="so-flair">
    <div id="gravatar"><?php print $flair_data->gravatarHtml; ?></div>
    <div id="reputation"><?php print $flair_data->reputation; ?></div>
    <div id="badges"><?php print $flair_data->badges; ?></div>
    <div id="displayname"><?php print $flair_data->displayname; ?></div>
    <a id="profileurl" href="<?php htmlspecialchars($flair_data->profileUrl); ?>">Visit my profile</a>
share|improve this answer
Using JavaScript only if it's possible. If it's not possible using JavaScript only, why? – Randell Apr 28 '10 at 13:02
What part of the JSON example on the flair page are you having problems with? – heavyd Apr 28 '10 at 13:10
It's a JSONP example. I'm looking for an example for client-side processing of the JSON. – Randell Apr 28 '10 at 13:13
Thanks headvyd. That explains it. – Randell Apr 29 '10 at 0:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .