Click here to Skip to main content
Rate this: bad
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 at 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 at 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 Sergey Alexandrovich Kryukov 565
1 Maciej Los 359
2 Kornfeld Eliyahu Peter 309
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,303
1 DamithSL 4,764
2 Maciej Los 4,306
3 Kornfeld Eliyahu Peter 3,914
4 Sergey Alexandrovich Kryukov 3,538

Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 8 Jan 2012
Copyright © CodeProject, 1999-2014
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