Click here to Skip to main content
11,920,211 members (44,518 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET Javascript
I want to fire a button click and get data from database just after facebook login, which returns Email ID., after facebook login with help of javascript. I am using

in below script, but it does'nt work?

<pre lang="Javascript">function updateButton(response) {
                                var button = document.getElementById('fb-auth');
                                var email = document.getElementById('lbemail');
                                var btn = document.getElementById('btnSend');
                                if (response.authResponse) {
                                    //user is already logged in and connected
                                    var userInfo = document.getElementById('user-info');
                                    FB.api('/me', function (response) {
                                   userInfo.innerHTML = '<img src="' + +               '/picture">' +;
                                        button.innerHTML = 'Logout';
                                    button.onclick = function () {
                                        FB.logout(function (response) {
                                        var userInfo = document.getElementById('user-info');
                                        userInfo.innerHTML = "";
Posted 7-Jan-12 0:38am
Edited 7-Jan-12 0:42am
Kethu Sasikanth 7-Jan-12 17:40pm
$('btnSend').. selector has a problem. It should have been $('.btnSend') if btnSend is class OR $('#btnSend') if btnSend is ctrl id.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try reading the documentation[^]

1) The selector is incorrect. It should be $('.btnSend') or $('#btnSend') for selecting a class or element identifier, or some form of this.

2) The trigger function should be trigger('click') if you want to trigger a button click event.
Wonde Tadesse 8-Jan-12 12:13pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

fire debugger plugin for firefox (or) IE browsewr also fired design,css,javascript also,so yo use this to check it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 455
1 phil.o 170
2 CPallini 150
4 F-ES Sitecore 130
0 OriginalGriff 6,778
1 KrunalRohit 4,495
2 Sergey Alexandrovich Kryukov 3,153
3 George Jonsson 2,810
4 Suvendu Shekhar Giri 2,181

Advertise | Privacy | Mobile
Web02 | 2.8.151120.1 | Last Updated 8 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100