Posts

Showing posts from October, 2012

Fetchinng Facebook Friend List Running Example Using Javascript Sdk

Only replace your Api Id from YourApiIdHere and fetch friend information acording to requirement


<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
        <title> 'FbFriends'</title>
        <script src="http://connect.facebook.net/en_US/all.js"></script>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <!--<link rel="stylesheet" type="text/css" href="styles.css">-->
  </head>
    <body>
     <div id="fb-root"></div&g…

Post on Friend's Wall without Facebook Pop up using Javascript Sdk.

function PostOnFriendsWall()
{
        var access_token=document.getElementById("access_token").value;
        var sendername=document.getElementById("sendername").value;
        status1 = document.getElementById('message').value;
        var facebookid = document.getElementsByName("facebookid");

        FB.api(
        {
            method: 'stream.publish',
            message: status1,
            target_id: facebookid,
            access_token:access_token,
            attachment: {
            name: ''Your Message Here by'+sendername+' via Javascript Sdk.',
            caption: 'Your Caption Here',
            description: ('Your Discription Here'),
            href: 'Your URL Here where you want to redirect after click',
            media: [
                    {
                        type: 'image',
                        href: 'Your URL Here where you want to redirect after…

Wall Post on Your Facebook Wall using Javascript Sdk

unction postOnSenderWallForMoneyGift()
{
    var FriendsName = document.getElementsByName("FriendsName");
    var access_token=document.getElementById("access_token").value;          
    for (i = 0; i< FriendsName.length; i++)
    { 
        recipient = FriendsName[i].value;
        FB.api(
        {
            method: 'stream.publish',
            access_token:access_token,
            attachment: {
            name: ''Your Message Here by'+sendername+' via Javascript Sdk.',
            caption: 'Your Caption Here',
            description: ('Your Discription Here'),
            href: 'Your URL Here where you want to redirect after click',
            media: [
                    {
                        type: 'image',
                        href: 'Your URL Here where you want to redirect after click',
                        src: 'Your Website Image Url if you want to display your…

Calling Ajax Function in Struts Running Example

function AjaxFunction()
{
    var xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
        alert ("Your browser does not support AJAX!");
        return;
    }
    var url="userwelcome.do?method=getContactById&contact_id="+cntId;
    xmlHttp.onreadystatechange=function()
    {
        if (xmlHttp.readyState==4)
        {
            var content=xmlHttp.responseText;
            document.getElementById("Res_Div_ID").innerHTML=    xmlHttp.responseText;
            document.getElementById("Div_ID").style.display        =    "none";
            document.getElementById("Disp_Div_ID").style.display=    "none";
        }
    };
    xmlHttp.open("POST",url,true);
    xmlHttp.send(null);
}

function GetXmlHttpObject()
{
    var xmlHttp=null;
    try
    {
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }catch (e)
    {
        // Internet Explorer
        try
        …